Skip to content

Commit 72000de

Browse files
Merge commit '0a715692d8e2536c899faa0bb4f0cec2c2e33e36' into internal-merge-7.0-2023-11-14-1019
2 parents df731ed + 0a71569 commit 72000de

File tree

9 files changed

+113
-48
lines changed

9 files changed

+113
-48
lines changed

NuGet.config

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44
<clear />
55
<!--Begin: Package sources managed by Dependency Flow automation. Do not edit the sources below.-->
66
<!-- Begin: Package sources from dotnet-efcore -->
7+
<add key="darc-int-dotnet-efcore-31662b3" value="https://pkgs.dev.azure.com/dnceng/internal/_packaging/darc-int-dotnet-efcore-31662b30/nuget/v3/index.json" />
78
<!-- End: Package sources from dotnet-efcore -->
89
<!-- Begin: Package sources from dotnet-runtime -->
10+
<add key="darc-int-dotnet-runtime-808851b" value="https://pkgs.dev.azure.com/dnceng/internal/_packaging/darc-int-dotnet-runtime-808851b0/nuget/v3/index.json" />
911
<!-- End: Package sources from dotnet-runtime -->
1012
<!--End: Package sources managed by Dependency Flow automation. Do not edit the sources above.-->
1113
<add key="dotnet-eng" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json" />
@@ -24,8 +26,10 @@
2426
<clear />
2527
<!--Begin: Package sources managed by Dependency Flow automation. Do not edit the sources below.-->
2628
<!-- Begin: Package sources from dotnet-efcore -->
29+
<add key="darc-int-dotnet-efcore-31662b3" value="true" />
2730
<!-- End: Package sources from dotnet-efcore -->
2831
<!-- Begin: Package sources from dotnet-runtime -->
32+
<add key="darc-int-dotnet-runtime-808851b" value="true" />
2933
<!-- End: Package sources from dotnet-runtime -->
3034
<!--End: Package sources managed by Dependency Flow automation. Do not edit the sources above.-->
3135
</disabledPackageSources>

eng/Version.Details.xml

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -9,37 +9,37 @@
99
-->
1010
<Dependencies>
1111
<ProductDependencies>
12-
<Dependency Name="dotnet-ef" Version="7.0.12">
12+
<Dependency Name="dotnet-ef" Version="7.0.14">
1313
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-efcore</Uri>
14-
<Sha>c20ecc79b7df3657e186ac52e7fc050beea36c92</Sha>
14+
<Sha>31662b30f1a4497db482b3aed8ed4c4aa6de801b</Sha>
1515
</Dependency>
16-
<Dependency Name="Microsoft.EntityFrameworkCore.InMemory" Version="7.0.12">
16+
<Dependency Name="Microsoft.EntityFrameworkCore.InMemory" Version="7.0.14">
1717
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-efcore</Uri>
18-
<Sha>c20ecc79b7df3657e186ac52e7fc050beea36c92</Sha>
18+
<Sha>31662b30f1a4497db482b3aed8ed4c4aa6de801b</Sha>
1919
</Dependency>
20-
<Dependency Name="Microsoft.EntityFrameworkCore.Relational" Version="7.0.12">
20+
<Dependency Name="Microsoft.EntityFrameworkCore.Relational" Version="7.0.14">
2121
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-efcore</Uri>
22-
<Sha>c20ecc79b7df3657e186ac52e7fc050beea36c92</Sha>
22+
<Sha>31662b30f1a4497db482b3aed8ed4c4aa6de801b</Sha>
2323
</Dependency>
24-
<Dependency Name="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.12">
24+
<Dependency Name="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.14">
2525
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-efcore</Uri>
26-
<Sha>c20ecc79b7df3657e186ac52e7fc050beea36c92</Sha>
26+
<Sha>31662b30f1a4497db482b3aed8ed4c4aa6de801b</Sha>
2727
</Dependency>
28-
<Dependency Name="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.12">
28+
<Dependency Name="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.14">
2929
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-efcore</Uri>
30-
<Sha>c20ecc79b7df3657e186ac52e7fc050beea36c92</Sha>
30+
<Sha>31662b30f1a4497db482b3aed8ed4c4aa6de801b</Sha>
3131
</Dependency>
32-
<Dependency Name="Microsoft.EntityFrameworkCore.Tools" Version="7.0.12">
32+
<Dependency Name="Microsoft.EntityFrameworkCore.Tools" Version="7.0.14">
3333
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-efcore</Uri>
34-
<Sha>c20ecc79b7df3657e186ac52e7fc050beea36c92</Sha>
34+
<Sha>31662b30f1a4497db482b3aed8ed4c4aa6de801b</Sha>
3535
</Dependency>
36-
<Dependency Name="Microsoft.EntityFrameworkCore" Version="7.0.12">
36+
<Dependency Name="Microsoft.EntityFrameworkCore" Version="7.0.14">
3737
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-efcore</Uri>
38-
<Sha>c20ecc79b7df3657e186ac52e7fc050beea36c92</Sha>
38+
<Sha>31662b30f1a4497db482b3aed8ed4c4aa6de801b</Sha>
3939
</Dependency>
40-
<Dependency Name="Microsoft.EntityFrameworkCore.Design" Version="7.0.12">
40+
<Dependency Name="Microsoft.EntityFrameworkCore.Design" Version="7.0.14">
4141
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-efcore</Uri>
42-
<Sha>c20ecc79b7df3657e186ac52e7fc050beea36c92</Sha>
42+
<Sha>31662b30f1a4497db482b3aed8ed4c4aa6de801b</Sha>
4343
</Dependency>
4444
<Dependency Name="Microsoft.Extensions.Caching.Abstractions" Version="7.0.0">
4545
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-runtime</Uri>
@@ -177,9 +177,9 @@
177177
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-runtime</Uri>
178178
<Sha>d099f075e45d2aa6007a22b71b45a08758559f80</Sha>
179179
</Dependency>
180-
<Dependency Name="Microsoft.Internal.Runtime.AspNetCore.Transport" Version="7.0.12-servicing.23477.20">
180+
<Dependency Name="Microsoft.Internal.Runtime.AspNetCore.Transport" Version="7.0.14-servicing.23519.10">
181181
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-runtime</Uri>
182-
<Sha>4a824ef37caa51072221584c64cbf15455f406ca</Sha>
182+
<Sha>808851b07acfa1c5c94b0d4f9fb50debedb2df70</Sha>
183183
</Dependency>
184184
<Dependency Name="Microsoft.SourceBuild.Intermediate.source-build-externals" Version="7.0.0-alpha.1.22505.1">
185185
<Uri>https://github.com/dotnet/source-build-externals</Uri>
@@ -242,9 +242,9 @@
242242
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-runtime</Uri>
243243
<Sha>d099f075e45d2aa6007a22b71b45a08758559f80</Sha>
244244
</Dependency>
245-
<Dependency Name="System.Text.Json" Version="7.0.3">
245+
<Dependency Name="System.Text.Json" Version="7.0.4">
246246
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-runtime</Uri>
247-
<Sha>5b20af47d99620150c53eaf5db8636fdf730b126</Sha>
247+
<Sha>808851b07acfa1c5c94b0d4f9fb50debedb2df70</Sha>
248248
</Dependency>
249249
<Dependency Name="System.Threading.AccessControl" Version="7.0.1">
250250
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-runtime</Uri>
@@ -262,33 +262,33 @@
262262
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-runtime</Uri>
263263
<Sha>d099f075e45d2aa6007a22b71b45a08758559f80</Sha>
264264
</Dependency>
265-
<Dependency Name="Microsoft.NETCore.App.Ref" Version="7.0.12">
265+
<Dependency Name="Microsoft.NETCore.App.Ref" Version="7.0.14">
266266
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-runtime</Uri>
267-
<Sha>4a824ef37caa51072221584c64cbf15455f406ca</Sha>
267+
<Sha>808851b07acfa1c5c94b0d4f9fb50debedb2df70</Sha>
268268
</Dependency>
269-
<Dependency Name="Microsoft.NET.Runtime.MonoAOTCompiler.Task" Version="7.0.12">
269+
<Dependency Name="Microsoft.NET.Runtime.MonoAOTCompiler.Task" Version="7.0.14">
270270
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-runtime</Uri>
271-
<Sha>4a824ef37caa51072221584c64cbf15455f406ca</Sha>
271+
<Sha>808851b07acfa1c5c94b0d4f9fb50debedb2df70</Sha>
272272
</Dependency>
273-
<Dependency Name="Microsoft.NET.Runtime.WebAssembly.Sdk" Version="7.0.12">
273+
<Dependency Name="Microsoft.NET.Runtime.WebAssembly.Sdk" Version="7.0.14">
274274
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-runtime</Uri>
275-
<Sha>4a824ef37caa51072221584c64cbf15455f406ca</Sha>
275+
<Sha>808851b07acfa1c5c94b0d4f9fb50debedb2df70</Sha>
276276
</Dependency>
277277
<!--
278278
Win-x64 is used here because we have picked an arbitrary runtime identifier to flow the version of the latest NETCore.App runtime.
279279
All Runtime.$rid packages should have the same version.
280280
-->
281-
<Dependency Name="Microsoft.NETCore.App.Runtime.win-x64" Version="7.0.12">
281+
<Dependency Name="Microsoft.NETCore.App.Runtime.win-x64" Version="7.0.14">
282282
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-runtime</Uri>
283-
<Sha>4a824ef37caa51072221584c64cbf15455f406ca</Sha>
283+
<Sha>808851b07acfa1c5c94b0d4f9fb50debedb2df70</Sha>
284284
</Dependency>
285-
<Dependency Name="Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.browser-wasm" Version="7.0.12">
285+
<Dependency Name="Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.browser-wasm" Version="7.0.14">
286286
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-runtime</Uri>
287-
<Sha>4a824ef37caa51072221584c64cbf15455f406ca</Sha>
287+
<Sha>808851b07acfa1c5c94b0d4f9fb50debedb2df70</Sha>
288288
</Dependency>
289-
<Dependency Name="Microsoft.NETCore.BrowserDebugHost.Transport" Version="7.0.12-servicing.23477.20">
289+
<Dependency Name="Microsoft.NETCore.BrowserDebugHost.Transport" Version="7.0.14-servicing.23519.10">
290290
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-runtime</Uri>
291-
<Sha>4a824ef37caa51072221584c64cbf15455f406ca</Sha>
291+
<Sha>808851b07acfa1c5c94b0d4f9fb50debedb2df70</Sha>
292292
</Dependency>
293293
<Dependency Name="Microsoft.Web.Xdt" Version="7.0.0-preview.22423.2">
294294
<Uri>https://github.com/dotnet/xdt</Uri>

eng/Versions.props

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,12 @@
6363
<PropertyGroup Label="Automated">
6464
<!-- Packages from dotnet/runtime -->
6565
<MicrosoftExtensionsDependencyModelVersion>7.0.0</MicrosoftExtensionsDependencyModelVersion>
66-
<MicrosoftNETCoreAppRefVersion>7.0.12</MicrosoftNETCoreAppRefVersion>
67-
<MicrosoftNETCoreAppRuntimewinx64Version>7.0.12</MicrosoftNETCoreAppRuntimewinx64Version>
68-
<MicrosoftNETRuntimeMonoAOTCompilerTaskVersion>7.0.12</MicrosoftNETRuntimeMonoAOTCompilerTaskVersion>
69-
<MicrosoftNETRuntimeWebAssemblySdkVersion>7.0.12</MicrosoftNETRuntimeWebAssemblySdkVersion>
70-
<MicrosoftNETCoreAppRuntimeAOTwinx64CrossbrowserwasmVersion>7.0.12</MicrosoftNETCoreAppRuntimeAOTwinx64CrossbrowserwasmVersion>
71-
<MicrosoftNETCoreBrowserDebugHostTransportVersion>7.0.12-servicing.23477.20</MicrosoftNETCoreBrowserDebugHostTransportVersion>
66+
<MicrosoftNETCoreAppRefVersion>7.0.14</MicrosoftNETCoreAppRefVersion>
67+
<MicrosoftNETCoreAppRuntimewinx64Version>7.0.14</MicrosoftNETCoreAppRuntimewinx64Version>
68+
<MicrosoftNETRuntimeMonoAOTCompilerTaskVersion>7.0.14</MicrosoftNETRuntimeMonoAOTCompilerTaskVersion>
69+
<MicrosoftNETRuntimeWebAssemblySdkVersion>7.0.14</MicrosoftNETRuntimeWebAssemblySdkVersion>
70+
<MicrosoftNETCoreAppRuntimeAOTwinx64CrossbrowserwasmVersion>7.0.14</MicrosoftNETCoreAppRuntimeAOTwinx64CrossbrowserwasmVersion>
71+
<MicrosoftNETCoreBrowserDebugHostTransportVersion>7.0.14-servicing.23519.10</MicrosoftNETCoreBrowserDebugHostTransportVersion>
7272
<MicrosoftExtensionsCachingAbstractionsVersion>7.0.0</MicrosoftExtensionsCachingAbstractionsVersion>
7373
<MicrosoftExtensionsCachingMemoryVersion>7.0.0</MicrosoftExtensionsCachingMemoryVersion>
7474
<MicrosoftExtensionsConfigurationAbstractionsVersion>7.0.0</MicrosoftExtensionsConfigurationAbstractionsVersion>
@@ -103,7 +103,7 @@
103103
<MicrosoftExtensionsOptionsDataAnnotationsVersion>7.0.0</MicrosoftExtensionsOptionsDataAnnotationsVersion>
104104
<MicrosoftExtensionsOptionsVersion>7.0.1</MicrosoftExtensionsOptionsVersion>
105105
<MicrosoftExtensionsPrimitivesVersion>7.0.0</MicrosoftExtensionsPrimitivesVersion>
106-
<MicrosoftInternalRuntimeAspNetCoreTransportVersion>7.0.12-servicing.23477.20</MicrosoftInternalRuntimeAspNetCoreTransportVersion>
106+
<MicrosoftInternalRuntimeAspNetCoreTransportVersion>7.0.14-servicing.23519.10</MicrosoftInternalRuntimeAspNetCoreTransportVersion>
107107
<SystemConfigurationConfigurationManagerVersion>7.0.0</SystemConfigurationConfigurationManagerVersion>
108108
<SystemDiagnosticsDiagnosticSourceVersion>7.0.2</SystemDiagnosticsDiagnosticSourceVersion>
109109
<SystemDiagnosticsEventLogVersion>7.0.0</SystemDiagnosticsEventLogVersion>
@@ -118,21 +118,21 @@
118118
<SystemSecurityPermissionsVersion>7.0.0</SystemSecurityPermissionsVersion>
119119
<SystemServiceProcessServiceControllerVersion>7.0.1</SystemServiceProcessServiceControllerVersion>
120120
<SystemTextEncodingsWebVersion>7.0.0</SystemTextEncodingsWebVersion>
121-
<SystemTextJsonVersion>7.0.3</SystemTextJsonVersion>
121+
<SystemTextJsonVersion>7.0.4</SystemTextJsonVersion>
122122
<SystemThreadingAccessControlVersion>7.0.1</SystemThreadingAccessControlVersion>
123123
<SystemThreadingChannelsVersion>7.0.0</SystemThreadingChannelsVersion>
124124
<SystemThreadingRateLimitingVersion>7.0.1</SystemThreadingRateLimitingVersion>
125125
<!-- Only listed explicitly to workaround https://github.com/dotnet/cli/issues/10528 -->
126126
<MicrosoftNETCorePlatformsVersion>7.0.4</MicrosoftNETCorePlatformsVersion>
127127
<!-- Packages from dotnet/efcore -->
128-
<dotnetefVersion>7.0.12</dotnetefVersion>
129-
<MicrosoftEntityFrameworkCoreInMemoryVersion>7.0.12</MicrosoftEntityFrameworkCoreInMemoryVersion>
130-
<MicrosoftEntityFrameworkCoreRelationalVersion>7.0.12</MicrosoftEntityFrameworkCoreRelationalVersion>
131-
<MicrosoftEntityFrameworkCoreSqliteVersion>7.0.12</MicrosoftEntityFrameworkCoreSqliteVersion>
132-
<MicrosoftEntityFrameworkCoreSqlServerVersion>7.0.12</MicrosoftEntityFrameworkCoreSqlServerVersion>
133-
<MicrosoftEntityFrameworkCoreToolsVersion>7.0.12</MicrosoftEntityFrameworkCoreToolsVersion>
134-
<MicrosoftEntityFrameworkCoreVersion>7.0.12</MicrosoftEntityFrameworkCoreVersion>
135-
<MicrosoftEntityFrameworkCoreDesignVersion>7.0.12</MicrosoftEntityFrameworkCoreDesignVersion>
128+
<dotnetefVersion>7.0.14</dotnetefVersion>
129+
<MicrosoftEntityFrameworkCoreInMemoryVersion>7.0.14</MicrosoftEntityFrameworkCoreInMemoryVersion>
130+
<MicrosoftEntityFrameworkCoreRelationalVersion>7.0.14</MicrosoftEntityFrameworkCoreRelationalVersion>
131+
<MicrosoftEntityFrameworkCoreSqliteVersion>7.0.14</MicrosoftEntityFrameworkCoreSqliteVersion>
132+
<MicrosoftEntityFrameworkCoreSqlServerVersion>7.0.14</MicrosoftEntityFrameworkCoreSqlServerVersion>
133+
<MicrosoftEntityFrameworkCoreToolsVersion>7.0.14</MicrosoftEntityFrameworkCoreToolsVersion>
134+
<MicrosoftEntityFrameworkCoreVersion>7.0.14</MicrosoftEntityFrameworkCoreVersion>
135+
<MicrosoftEntityFrameworkCoreDesignVersion>7.0.14</MicrosoftEntityFrameworkCoreDesignVersion>
136136
<!-- Packages from dotnet/arcade -->
137137
<MicrosoftDotNetBuildTasksInstallersVersion>7.0.0-beta.23556.6</MicrosoftDotNetBuildTasksInstallersVersion>
138138
<MicrosoftDotNetBuildTasksTemplatingVersion>7.0.0-beta.23556.6</MicrosoftDotNetBuildTasksTemplatingVersion>

src/Components/Components/src/ComponentBase.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,4 +326,7 @@ Task IHandleAfterRender.OnAfterRenderAsync()
326326
// have to use "async void" and do their own exception handling in
327327
// the case where they want to start an async task.
328328
}
329+
330+
// Exists for 6.0/7.0 patch only. A different solution is used from .NET 8 onwards.
331+
internal bool IsComponentDisposed() => _renderHandle.IsComponentDisposed();
329332
}

src/Components/Components/src/RenderHandle.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,7 @@ private static void ThrowNotInitialized()
7070
{
7171
throw new InvalidOperationException("The render handle is not yet assigned.");
7272
}
73+
74+
// Exists for 6.0/7.0 patch only. A different solution is used from .NET 8 onwards.
75+
internal bool IsComponentDisposed() => _renderer?.IsComponentDisposed(_componentId) ?? false;
7376
}

src/Components/Components/src/RenderTree/Renderer.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,4 +1119,8 @@ public async ValueTask DisposeAsync()
11191119
}
11201120
}
11211121
}
1122+
1123+
// Exists for 6.0/7.0 patch only. A different solution is used from .NET 8 onwards.
1124+
internal bool IsComponentDisposed(int componentId)
1125+
=> !_componentStateById.ContainsKey(componentId);
11221126
}

src/Components/Web/src/Forms/EditForm.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,12 @@ private async Task HandleSubmitAsync()
136136
{
137137
Debug.Assert(_editContext != null);
138138

139+
// Exists for 6.0/7.0 patch only. A different solution is used from .NET 8 onwards.
140+
if (IsComponentDisposed())
141+
{
142+
return;
143+
}
144+
139145
if (OnSubmit.HasDelegate)
140146
{
141147
// When using OnSubmit, the developer takes control of the validation lifecycle

src/Components/test/E2ETest/Tests/FormsTest.cs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -809,6 +809,39 @@ public void CanHaveModelLevelValidationErrors()
809809
Browser.Collection(logEntries, x => Assert.Equal("OnValidSubmit", x));
810810
}
811811

812+
[Fact]
813+
public async Task CannotSubmitEditFormSynchronouslyAfterItWasRemoved()
814+
{
815+
var appElement = MountSimpleValidationComponent();
816+
817+
var submitButtonFinder = By.CssSelector("button[type=submit]");
818+
Browser.Exists(submitButtonFinder);
819+
820+
// Remove the form then immediately also submit it, so the server receives both
821+
// the 'remove' and 'submit' commands (in that order) before it updates the UI
822+
appElement.FindElement(By.Id("remove-form")).Click();
823+
824+
try
825+
{
826+
appElement.FindElement(submitButtonFinder).Click();
827+
}
828+
catch (NoSuchElementException)
829+
{
830+
// This should happen on WebAssembly because the form will be removed synchronously
831+
// That means the test has passed
832+
return;
833+
}
834+
835+
// Wait for the removal to complete, which is intentionally delayed to ensure
836+
// this test can submit a second instruction before the first is processed. Then
837+
// wait a bit more to be really sure the second instruction was processed.
838+
Browser.DoesNotExist(submitButtonFinder);
839+
await Task.Delay(1000);
840+
841+
// Verify that the form submit event was not processed
842+
Browser.DoesNotExist(By.Id("last-callback"));
843+
}
844+
812845
private Func<string[]> CreateValidationMessagesAccessor(IWebElement appElement, string messageSelector = ".validation-message")
813846
{
814847
return () => appElement.FindElements(By.CssSelector(messageSelector))

src/Components/test/testassets/BasicTestApp/FormsTest/SimpleValidationComponent.razor

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
@using System.ComponentModel.DataAnnotations
22
@using Microsoft.AspNetCore.Components.Forms
33

4+
@if (!removeForm)
5+
{
46
<EditForm Model="@this" OnValidSubmit="@HandleValidSubmit" OnInvalidSubmit="@HandleInvalidSubmit" autocomplete="off">
57
<DataAnnotationsValidator />
68

@@ -22,16 +24,20 @@
2224
</ul>
2325

2426
</EditForm>
27+
}
2528

2629
@if (lastCallback != null)
2730
{
2831
<span id="last-callback">@lastCallback</span>
2932
}
3033

34+
<p><button id="remove-form" @onclick="RemoveForm">Remove form</button></p>
35+
3136
@code {
3237
protected virtual bool UseExperimentalValidator => false;
3338

3439
string lastCallback;
40+
bool removeForm;
3541

3642
[Required(ErrorMessage = "Please choose a username")]
3743
public string UserName { get; set; }
@@ -49,4 +55,10 @@
4955
{
5056
lastCallback = "OnInvalidSubmit";
5157
}
58+
59+
void RemoveForm()
60+
{
61+
removeForm = true;
62+
Thread.Sleep(1000); // To ensure we can dispatch another event before this completes
63+
}
5264
}

0 commit comments

Comments
 (0)