dotnet / dotnet/aspnetcore

Blazor SSR: enhanced form not working inside a dialog

Open
#65,584 6 comments 0 reactions 0 assignees View on GitHub
area-blazor investigate
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 10h
Merged PRs (30d)
281

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Describe the bug

Enhanced form causes the dialog to close after submit, and UI becomes unresponsive:
```razor
Open modal

```
If I set `data-permanent` on a div wrapping the dialog, of course the issue goes away, but then my dialog becomes static...

I can handle submission in JavaScript and replace the HTML by hand, which works, but defeats the purpose of using enhanced navigation. Maybe I should switch to HTMX? I will if this is considered "by design" :)

### Expected Behavior

Form HTML should be replaced without touching the dialog, since the form is inside the dialog and only the form and its children should be affected by enhanced loading.

### Steps To Reproduce

- Open dialog by clicking button
- Submit form
- Observe how dialog closes (shouldn't) and UI becomes unresponsive (as if invisible modal)

### Exceptions (if any)

_No response_

### .NET Version

10.0.103

### Anything else?

ASP.NET Core version: 10.0.3
IDE: Visual Studio 2026 Community
Tailwind version: 4.1.17
daisyUI version: 5.5.8

dotnet --info output:

> .NET SDK:
> Version: 10.0.103
> Commit: c2435c3e0f
> Workload version: 10.0.100-manifests.c992be6d
> MSBuild version: 18.0.11+c2435c3e0
>
> Runtime Environment:
> OS Name: Windows
> OS Version: 10.0.26200
> OS Platform: Windows
> RID: win-x64
> Base Path: C:\Program Files\dotnet\sdk\10.0.103\
>
> .NET workloads installed:
> [maccatalyst]
> Installation Source: VS 18.3.11520.95
> Manifest Version: 26.2.10191/10.0.100
> Manifest Path: C:\Program Files\dotnet\sdk-manifests\10.0.100\microsoft.net.sdk.maccatalyst\26.2.10191\WorkloadManifest.json
> Install Type: Msi
>
> [ios]
> Installation Source: VS 18.3.11520.95
> Manifest Version: 26.2.10191/10.0.100
> Manifest Path: C:\Program Files\dotnet\sdk-manifests\10.0.100\microsoft.net.sdk.ios\26.2.10191\WorkloadManifest.json
> Install Type: Msi
>
> [android]
> Installation Source: VS 18.3.11520.95
> Manifest Version: 36.1.2/10.0.100
> Manifest Path: C:\Program Files\dotnet\sdk-manifests\10.0.100\microsoft.net.sdk.android\36.1.2\WorkloadManifest.json
> Install Type: Msi
>
> [wasm-tools]
> Installation Source: VS 18.3.11520.95
> Manifest Version: 10.0.103/10.0.100
> Manifest Path: C:\Program Files\dotnet\sdk-manifests\10.0.100\microsoft.net.workload.mono.toolchain.current\10.0.103\WorkloadManifest.json
> Install Type: Msi
>
> [maui-windows]
> Installation Source: VS 18.3.11520.95
> Manifest Version: 10.0.20/10.0.100
> Manifest Path: C:\Program Files\dotnet\sdk-manifests\10.0.100\microsoft.net.sdk.maui\10.0.20\WorkloadManifest.json
> Install Type: Msi
>
> Configured to use workload sets when installing new manifests.
> No workload sets are installed. Run "dotnet workload restore" to install a workload set.
>
> Host:
> Version: 10.0.3
> Architecture: x64
> Commit: c2435c3e0f
>
> .NET SDKs installed:
> 10.0.103 [C:\Program Files\dotnet\sdk]
>
> .NET runtimes installed:
> Microsoft.AspNetCore.App 8.0.24 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
> Microsoft.AspNetCore.App 10.0.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
> Microsoft.NETCore.App 8.0.24 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
> Microsoft.NETCore.App 10.0.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
> Microsoft.WindowsDesktop.App 8.0.24 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
> Microsoft.WindowsDesktop.App 10.0.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
>
> Other architectures found:
> x86 [C:\Program Files (x86)\dotnet]
> registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]
>
> Environment variables:
> DOTNET_CLI_TELEMETRY_OPTOUT [true]
>
> global.json file:
> Not found
>
> Learn more:
> https://aka.ms/dotnet/info
>
> Download .NET:
> https://aka.ms/dotnet/download

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.