Skip to content

Fix Input Overwrites #799

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

Closed
rmorshea opened this issue Aug 12, 2022 · 3 comments
Closed

Fix Input Overwrites #799

rmorshea opened this issue Aug 12, 2022 · 3 comments
Labels
priority-2-moderate Should be resolved on a reasonable timeline.
Milestone

Comments

@rmorshea
Copy link
Collaborator

Current Situation

We implemented a solution to prevent input overwrites due to the async handling of onChange. However, the same issue happens for other handlers (e.g. onKeyDown).

Proposed Actions

Generalize the solution. Instead of only applying the input solution when an onChange handler is present, always handle the input value this way.

@rmorshea rmorshea added the flag-triage Not prioritized. label Aug 12, 2022
@rmorshea rmorshea added type: bug priority-2-moderate Should be resolved on a reasonable timeline. and removed flag-triage Not prioritized. labels Aug 12, 2022
@rmorshea
Copy link
Collaborator Author

I'm not sure if this is true in browsers besides Chrome or if this is just a behavior of React, but for some reason, the only handler which accurately gets the current value of an input is onChange.

@rmorshea
Copy link
Collaborator Author

I can't remember where I read it, but I think this is a behavior of onChange. onChange is the only event that is guaranteed to get the correct value of an input when it changes.

@rmorshea
Copy link
Collaborator Author

rmorshea commented Nov 30, 2022

I'm closing for now. This issue doesn't seem to come up in practice and I'm pretty sure I've seen this happen in other app where inputs are controlled by the backend so I'm not really sure it can be fixed. Can re-open if this problem rears its head again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority-2-moderate Should be resolved on a reasonable timeline.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants