MudBlazor/MudBlazor

MudTextField Mask property prevents reloading an earlier version of a form

Aperta

#11.833 aperta il 28 ago 2025

 (0 commenti) (1 reazione) (0 assegnatari)C# (1631 fork)batch import
buggood first issue

Metriche repository

Star
 (10.394 stelle)
Metriche merge PR
 (Merge medio 6g 6h) (108 PR mergiate in 30 g)

Descrizione

Before reporting

  • I searched existing issues
  • I tried in private/incognito browser

What went wrong?

The Mask property makes the MudTextField behave differently. In this issue, I am trying to reset a form back to an earlier stage (not by using form.ResetAsync() but a custom method that resets the form to an earlier version of the DTO). The "Reset" button works whenever there is no "Mask" property, but does not clear the text field when the "Mask" property is present.

https://github.com/user-attachments/assets/17be9b9c-cf45-4dff-9748-c76196da7942

Reproduction link

https://try.mudblazor.com/snippet/cEGJEiwCQNgzZSUQ

Reproduction steps

  1. Have a MudTextField with a RegexMask
  2. Enter some data into it e.g. 12345 in the repro link
  3. Press the "Reset" button (NOTE: This does not use form.ResetAsync(), this is a custom method that loads an earlier version of the DTO. Imagine picking up a form from where you left off, making a few mistakes, you don't clear the form to blank you instead load the earlier version).

Expected: The MudTextField should be empty

Actual: The MudTextField holds onto the data whenever it has a Mask. Without the Mask property, this works fine. Try removing the Mask property and repeat the above steps.

Version (bug)

8.11.0

Version (working)

N/A

Environment

Edge

Blazor rendering mode

WASM

Guida contributor