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

Cancel old debounced handlers when new one is sent in props #78

Merged
merged 2 commits into from
Oct 31, 2023

Conversation

st-angelo
Copy link
Contributor

Previously, when onChange changed, a new debounced function was created, but the old one would still be active. This meant that typing new characters would delay the execution of the new function, but the old one would not be further delayed by user input and would then come and overwrite your value once the timer elapsed.

Now, whenever onChange changes, the old handler is canceled.

@st-angelo st-angelo linked an issue Oct 31, 2023 that may be closed by this pull request
1 task
@st-angelo st-angelo merged commit fc08ee8 into master Oct 31, 2023
@st-angelo st-angelo deleted the debounce-fix-for-inputs branch October 31, 2023 10:10
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

Successfully merging this pull request may close these issues.

TextField value flickers and cuts characters when debounced
2 participants