Blazor Component Library based on Material design with an emphasis on ease of use. Mainly written in C# with Javascript kept to a bare minimum it empowers .NET developers to easily debug it if needed.
MudNumericField autocorrects invalid input instead of just validating. It is way worse situation to autocorrect number with digits after unsupported decimal separator without user noticing, than just leave the value untouched with validation message.
Prime example is using MudNumericField for currency input. Application could switch between different CultureInfo settings or the user could use their local decimal separator. When the decimal separator is different, then the culture currently set, MudNumeric field autocorrects input value for example from 123,5 to 1235 which could be a big problem.
This autocorrect behavior should not be set by default, or at least there should be option to disable it.
Update:
Maybe it is not incorrect behaviour, since I am using en-US culture and ',' character is used as CultureInfo.NumberFormat.CurrencyGroupSeparator and CultureInfo.NumberFormat.NumberGroupSeparator.
With my culture settings, we use ',' as a decimal separator. So it's easy to make a mistake. So while the autocorrect function may not be wrong, I would still like to have a way to disable this autocorrect behavior. Instead I would rather call validation method.
Expected behavior
MudNumericField does not autocorrect invalid value.
Input decimal value with at least one non-zero digit after decimal separator into MudNumericField using different separator than CultureInfo.CurrentCulture is using, for example if en-US culture is set, use ',' as decimal separator. Input for example "0,5" if CurrentCulture is using different separator than ','.
Switch focus using tab or just click some other page element (button).
See how MudNumericField autocorrected value with simply removing decimal separator.
Relevant log output
No response
Version (bug)
6.19.1
Version (working)
No response
What browsers are you seeing the problem on?
Edge
On which operating systems are you experiencing the issue?
Windows
Pull Request
[ ] I would like to do a Pull Request
Code of Conduct
[X] I agree to follow this project's Code of Conduct
Bug type
Component
Component name
MudNumericField
What happened?
MudNumericField autocorrects invalid input instead of just validating. It is way worse situation to autocorrect number with digits after unsupported decimal separator without user noticing, than just leave the value untouched with validation message.
Prime example is using MudNumericField for currency input. Application could switch between different CultureInfo settings or the user could use their local decimal separator. When the decimal separator is different, then the culture currently set, MudNumeric field autocorrects input value for example from 123,5 to 1235 which could be a big problem.
This autocorrect behavior should not be set by default, or at least there should be option to disable it.
Update:
Maybe it is not incorrect behaviour, since I am using en-US culture and ',' character is used as
CultureInfo.NumberFormat.CurrencyGroupSeparator
andCultureInfo.NumberFormat.NumberGroupSeparator
.With my culture settings, we use ',' as a decimal separator. So it's easy to make a mistake. So while the autocorrect function may not be wrong, I would still like to have a way to disable this autocorrect behavior. Instead I would rather call validation method.
Expected behavior
MudNumericField does not autocorrect invalid value.
Reproduction link
https://try.mudblazor.com/snippet/wOweOTbkmigbVTCr
Reproduction steps
Relevant log output
No response
Version (bug)
6.19.1
Version (working)
No response
What browsers are you seeing the problem on?
Edge
On which operating systems are you experiencing the issue?
Windows
Pull Request
Code of Conduct