Skip to content
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

Input element value goes out of sync from component state field it's bound to #158

Open
mnegulescu opened this issue Apr 6, 2020 · 0 comments

Comments

@mnegulescu
Copy link

Explain the problem
When the state field bound to an input is updated the second time to the same value, the value of the input element goes out of sync with the component state, seems like a caching issue. It seems that the first update of the field is reflected by the input's value, but the second time, as the field is updated to the same value, the DOM is not updated any more.

Expected Behaviour
The value of the input element should be updated every time the state is updated, and should not go out of sync from the component state.

Actual Behaviour
The second time the state is emitted with the same value for the input, the value of the input element does not change, and no longer reflects the value bound to it.

Steps to reproduce
Create a component where a field of the component state is bound to the value of an input element. Add logic that limits the number of the field (validation), which sets a predefined max or min number of the number manually set is out of bounds. Manually set a number lower or higher than allowed, so the state logic emits the same max or min number consecutively. The second time the same state value is emitted for that input, it will go out of sync.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant