-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
MudTextField: With mask, setting parameter value updates the input text #10328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #10328 +/- ##
=======================================
Coverage 91.42% 91.43%
=======================================
Files 415 415
Lines 13039 13039
Branches 2475 2475
=======================================
+ Hits 11921 11922 +1
Misses 551 551
+ Partials 567 566 -1 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change itself looks good to me. Not an expert in masking, never used it to be fair.
@henon ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @vernou good fix.
Description
Fixes #10252
When
MudTextField
has a mask of typePatternMask
, set the parameterMudTextField.Value
update the input text. But if the mask is of another type, then the input text isn't updated.The reason is the default mask in
MudMask
is aPatternMask
:So when
MudTextField
set the mask of typePatternMask
toMudMask
, they don't share the same instance :And it's work fine. But when
MudTextField
set the mask of another typePatternMask
toMudMask
, they share the same instance.MudMask
update the inner text whenMudMask.Mask.Text
is different toMudTextField.Mask.Text
. But likeMudMask.Mask
andMudTextField.Mask
is the same instance, the condition is always false.To fix the problem, I modified the condition to verrify if the
MudMask
inner text is different fromMudTextField.Mask.Text
.How Has This Been Tested?
I added tests for each
IMask
implementation.Type of Changes
Checklist
dev
).