fix: Missing support of unsigned numerics in FluentNumberField
#2882
Labels
community:contribution
Issue will/can be addressed by community contribution
🐛 Bug Report
I chose "bug" over "feature request" since a component named
FluentNumberField
should have supported the unsigned equivalents ofint
,long
,sbyte
&short
right from the start.Because I can't imagine a reason to not enable developers to limit sliders, steppers, etc. to positive values only (talking mostly age, RGB color & range pickers here, but applies to customer ID fields as well).
On a more personal note, I'm really having a hard time understanding why (C#) developers still prefer
int CustomerId
overuint CustomerId
since such a property never really contains a negative integer.But I assume it's just like with
decimal
which - besides scientific calculations - should always be preferred overfloat
&double
(AFAIK, even the C# docs explicitly state this).. 😅💻 Repro or Code Sample
🤔 Expected Behavior
As I explicitly declared
HideStep="true"
above, the following method shouldn't even get called.However, if it's necessary for some reason, this code inside
FluentNumberField.razor.cs
:should include the 4 unsigned numerics, too.
😯 Current Behavior
A
InvalidOperationException
is thrown:💁 Possible Solution
I'd like to do a PR to add those 4 types, if the maintainers would agree with me. 😉
🔦 Context
Provide my app's users with a couple of numeric input fields which are completely preventing any negative value.
On a side note, the XML Doc for
Max
&Min
should clarify ifMaxlength
&Minlength
are needed anyway or if the former already take care of that.🌍 Your Environment
The text was updated successfully, but these errors were encountered: