-
Notifications
You must be signed in to change notification settings - Fork 0
ERA-10520: Support EFB schemas in ER > Numeric field #1208
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
Regarding the disadvantages of the native numeric input type, I have replaced it with a simple text with some tweaks which will improve the UX and the accessibility for the input, anyways, event if this text input is behaving as a numeric one it doesn't render the control of the counter (the two arrows for augmenting/reducing the input value) I'm more the happy to add that missing piece, just wanted to ask about your opinion if that would be a worthy effort 🫡 |
As discussed with the team, I will be creating a re-usable custom component for input numeric, this will give us the opportunity to use it not only in the EFB support but in the entire application when required |
I've added a prop to the custom component that controls numeric range validation, so for the Numeric EFB implementation I have deactivated this feature, meaning a user can type numbers out of the range (also applies for the arrow buttons) letting the validation happens only at submit (also added a more meaningful validation error) Regarding the point 3, I have added a piece of logic to keep the 2.0 or 5.0 or any X.0 number shown with the digits, anyway the data is being stored as plain integer number, this due the parsing mechanism of JS. Meaning the user is allowed to use/type |
Just providing my share:
Yes, and with the new forms we don't want those native validations anymore. They are inconsistent in different browsers and disruptive with the flow of a HTML form. We are now handling our own error messages on submission and our fields are more restrictive so the users don't reach an error state (we try to enforce valid values while the user fills the inputs).
Yes, and just as you mentioned, it's a concern around web technologies. Most libraries disable that functionality since it's pretty common that users scrolling a form modify the value in the input without noticing. I feel like we shouldn't really try to stay with the old implementation if what we are doing enhancements to the fields. Adding our custom error messages, following best practices or adding mechanisms to help the user navigate or fill the form faster may make the experience a bit different and will be new to users, but should be better in the short term @AlanCalvillo . |
That context about inconsistency makes sense. I'm just doubtful about the possible confusion it might create for users who consume a form(but didn't create it themselves) and when trying to input a value outside the range, then the UI will not allow them to do so, and won't have any visual feedback. Hints/Description should add clarity, though. |
Love the inline errors 😍 The way the input range is working now is great. @AlanCalvillo I'm seeing now that you can type in any numeric input and the field gets validated on save or if the user hits enter while the field is focused. Some other feedback
I agree w/ Alan here, we should keep whatever value the user types in. Since don't have a way for the user to specify formatting of the number inputed in the form builder we shouldn't assume that the input should be a whole number. It's very possible that the user will have to type in a value like 20.45 to say how much something cost for example. |
I'd say this is getting a bit out of scope 😅 We haven't done anything similar to other fields. All validations are done on submission. Also, I'm not sure I've seen a form anywhere else with that kind of validations. Even native HTML numeric input simply won't allow you to enter invalid characters: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/number That's pretty standard. I feel like admins have some responsibility too to write good labels, descriptions and hints to help their users to understand the forms.
I think Gabo mentioned that the only values that are stored as integers are if they have only zeroes after the dot, like |
As Luis mentioned, currently only the values which has only a zero as decimal digit and thanks for the feedback of the validation messages I will be addressing it |
Yep, it got addressed after the comment 😄 |
I think it's almost there. I'm just having issues when handling multiple zeroes:
Screen.Recording.2025-01-22.at.17.06.07.mov |
Good catch @AlanCalvillo |
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.
let's friggin' gooo 💥 🚀 🚀 🚀
What does this PR do?
How does it look
Relevant link(s)
Where / how to start reviewing (optional)