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
Now it's clearing to empty string, but this value can be also a user input. And in functionality of setting defaultValue to Input doesn't work correctly. There is one condition which set input fields to defaultValue only if they are undefined:
// Enable to set default value only if value is undefined
if(typeoffieldProps.value!=='undefined'){
return;
}
So for example if i have one form where some input (eg. select) has defaultValue and i clear this form by action clearForm it clears all values in state with empty string, but default value of this select won't be set because of condition above.
The text was updated successfully, but these errors were encountered:
I think that proper way to clean forms values could be set them to
undefined
value:onion-form/src/reducer.js
Line 12 in 5c7869b
Now it's clearing to empty string, but this value can be also a user input. And in functionality of setting defaultValue to Input doesn't work correctly. There is one condition which set input fields to defaultValue only if they are
undefined
:onion-form/src/connectField.js
Lines 132 to 135 in 5c7869b
So for example if i have one form where some input (eg. select) has defaultValue and i clear this form by action
clearForm
it clears all values in state with empty string, but default value of this select won't be set because of condition above.The text was updated successfully, but these errors were encountered: