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
A programmatic form reset should not fire a UI event (i.e. one that exists to capture manual interaction from the user), but it does. In the example below, onChange fires once per input field on the form that has been reset:
It is fine for a UI event to run code, but it makes no sense for code that runs to fire UI events!
My use case is that I need to track whether the form has been modified or not, and Formsy doesn't provide a way to check the pristine state of the form, only each field on it. So I need to implement a separate state tracker (boolean) which is set to true when a field is changed, and set to false on reset or save.
The text was updated successfully, but these errors were encountered:
Not sure about the first statement about firing the change event. We usually use it to update some state and we probably want to update it when the form is programatically reset too.
The problem with checking if the form is pristine is often encountered and we've had it on the project I'm working on too. We should definitely implement pristine flag on the form in 2.0
A programmatic form reset should not fire a UI event (i.e. one that exists to capture manual interaction from the user), but it does. In the example below, onChange fires once per input field on the form that has been reset:
It is fine for a UI event to run code, but it makes no sense for code that runs to fire UI events!
My use case is that I need to track whether the form has been modified or not, and Formsy doesn't provide a way to check the pristine state of the form, only each field on it. So I need to implement a separate state tracker (boolean) which is set to true when a field is changed, and set to false on reset or save.
The text was updated successfully, but these errors were encountered: