MudBlazor/MudBlazor

MudTextField Mask property prevents reloading an earlier version of a form

Offen

#11.833 geöffnet am 28.08.2025

 (0 Kommentare) (1 Reaktion) (0 zugewiesene Personen)C# (1.631 Forks)batch import
buggood first issue

Repository-Metriken

Stars
 (10.394 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 6T 6h) (108 gemergte PRs in 30 T)

Beschreibung

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

Contributor Guide