MudDialog: The close event caused text boxes within the dialog box that had not yet lost focus not to submit changes.
#13 172 ouverte le 6 mai 2026
Métriques du dépôt
- Stars
- (10 394 étoiles)
- Métriques de merge PR
- (Merge moyen 6j 6h) (108 PRs mergées en 30 j)
Description
Before reporting
- I searched existing issues
- I tried in private/incognito browser
What went wrong?
Bug type
Component
Component name
MudDialog
What happened?
I have a very simple dialog box containing only a MudTextField. In version 8.x.x, the logic is that after filling in the information and clicking the close button of the dialog box, the value of the MudTextField is submitted. However, in version 9.x.x, the logic is that after filling in the information and clicking the close button of the dialog box, the value of the MudTextField is not submitted. The MudTextField must first lose focus before clicking the close button for the value to be submitted.
Temporary solution
Google Gemini provides a temporary solution to this problem, add the following code to index.html.
<script>
document.addEventListener('mousedown', function(e) {
if (e.target.closest('button')) {
var activeEle = document.activeElement;
if (activeEle && (activeEle.tagName === 'INPUT' || activeEle.tagName === 'TEXTAREA')) {
activeEle.blur();
}
}
}, true);
</script>
Reproduction link
https://try.mudblazor.com/snippet/GuGAEfOqwpshyitU
Reproduction steps
- click button
- input something
- keep text filed focus
- close dialog
- click button again
- expect:show before input
- step3: if make text filed lost focus,then close dialog, work fine.
Version (bug)
v9.4.0
Version (working)
v8.15.0
Environment
Edge, Chrome
Blazor rendering mode
WASM