You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 10, 2024. It is now read-only.
In one project, when I clear the numbe input, the input field indicates missing value very shortly but returns to "it's ok" status. But if I add second exclamation mark there, the input field works correctly.
The text was updated successfully, but these errors were encountered:
These states are some times hard to understand. It is also possible that the using side calls things incorrectly.
Let's open up some states:
This function should return false if the field value is in incorrect state; and true if it is valid state
The required=true means that the field value can be undefined
So this line should be return required ? true : false; and the code uses just an optimized version of this code.
It could help to add unit tests for this function in any case.
Most likely this is because something elsewhere is setting state to undefined initially and changing the state later. Probably correct fix is not to display the field and/or disable it until the field is ready. One way to handle this is also to add a loader over the whole form until it has loaded the data. We just added enabled property to some fields and should add same to the rest of fields as well. This could be used to make the field disabled until it has correct state loaded. The component nor the hook cannot know when it has been provided with correct state.
Another option could be to design a state for asynchronous operations which could indicate to the component that the initial data has not been loaded yet.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
bugSomething isn't workinghelp wantedExtra attention is needed
As title says, I found a possible typo ("!" instead of "!!"), in the file:
fi.hg.frontend/blob/main/hooks/field/number/useFieldValidateNumberValueCallback.ts, line 30
In one project, when I clear the numbe input, the input field indicates missing value very shortly but returns to "it's ok" status. But if I add second exclamation mark there, the input field works correctly.
The text was updated successfully, but these errors were encountered: