-
Notifications
You must be signed in to change notification settings - Fork 376
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
fix: Number Field within an editform using validation will permanently break if a number outside the bounds of the type is entered #1345
Comments
The same behaviour is observed when you try to submit the form with empty value in the FluentNumberField. |
FYI @vnbaaij this is happening also in FluentUI Blazor website: https://www.fluentui-blazor.net/Forms However, using InputNumber works perfectly fine. |
This is an issue in the underlying web components script. We are blocked on fixiing this until it is fixed there. |
Can you estimate how long it will take for this issue to be fixed in the fast component? I am aksing that, because with this issue the FluentValidationMessage is quite unusable for InputFields. In this repo, issues are fixed very fast. Thank you for that! But I can imagine, that issues in the underlying libs can take quite long to be fixed? Correct me if my assumption is wrong - maybe the answer is "it depends" :-) But I refer here to #871 which is blocked by microsoft/fluentui#29738 Therefore, I have to decide if I should wait for a fix or find a workaround for the whole validation stuff... Is there a microsoft/fast or microsoft/fluentui issue that tracks this problem? |
I have no idea how long it will take. In general though, time it take to get things changed upstream tends to be rather long. |
We are running into the exact same issue with our web page having fluent number fields. A fix sooner will be great. What other alternate routes are out there? We could use the input type. Is there a quick css class reference(that you have used before) to give it a look and feel of a fluent number field component? |
The alternative I would recommend is a FluentTextField with an inputmode:
|
Thank you for the suggestion. |
@MarvinKlein1508 that is a solid alternative. With the re-focusing of the FAST project (see microsoft/fast#6955), I'm not seeing this getting fixed in the current v2 Fluent UI web components script (which uses FAST foundation). Not sure yet how to move forward with this particular component... |
Here is an alternative variation that means the input control will only succeed if a valid 2 decimal place number has been entered (This is the common case for me). It may make your controls better as well.
Thanks for your solution in #1345 (comment) |
Binding with a nullable field prevent this issue. |
Or a validation required attribute -(from |
🐛 Bug Report
Create an edit form with data validation, and insert a FluentNumberField.
When you enter a number large than the maximum allowed (or presumably lower than the minimum allowed), you get a validation error "The {property} field must be a number.". When you then enter a more sensible value, the validation error remains and the form remains unsubmittable and the form will not work until it is recreated.
💻 Repro or Code Sample
🤔 Expected Behavior
Error message should represent the actual issue, not state that it is not a number.
Then, when number is corrected, the field and form should operate correctly once again.
😯 Current Behavior
💁 Possible Solution
🔦 Context
This makes using NumberFields and form validation difficult to justify.
🌍 Your Environment
The text was updated successfully, but these errors were encountered: