Open johnpreed opened 5 years ago
Hi, @johnpreed. Thank you for reporting this. My apologies for getting back to you after such delay.
I think this issue has to do with concurrency of state updates. It's been a problematic aspect for long time, and I've tried to solve it once and for all under #354. It may also be related, if not identical, to #352.
I am quite busy with other things now, but I will try to publish that changes so you can test out if new state update mechanism would eliminate the issue you are describing.
Environment
What
Current behavior
A field with a reactive rule does not reset to a non-error state after its error state has been initially triggered. To clarify, if a custom rule is set on a field and you set the required attribute to depend on another field having a value, it is not reset if you delete the value from the other field. To get the value back to a good state, you have to refresh the page in the browser.
Use Case
This is happening when I'm implementing a password change form between old, new and confirm password fields.
Expected behavior
If a field with a conditional required reactive prop has been triggered to an error state, if you remove the value from the field on which it depends, the field with the reactive rule should be set to a non-error state.
How
I modified the SingleTarget example in your codebase on the master branch to exhibit the bug.
npm run storybook