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

add onBlur handler to compensate for no onChange after a paste #328

Closed
wants to merge 3 commits into from

Conversation

dkackman
Copy link
Contributor

@dkackman dkackman commented Feb 11, 2025

Fix #315

MaskedInput is not raising onChange when a value that gets masked is pasted. Specically, if a value like " 1.0" is pasted this handler isn't being triggered.

uNmAnNeR/imaskjs#1063

onChange={(e) => {
  assets.cats[i].amount = e.target.value;
  setAssets({ ...assets });
}}

Since that is idempotent, adding an identical onBlur handler seems to work around this limitation.

Video showing repro steps. The value pasted is " 111.11", the leading non-numeric value is the trigger.

https://share.icloud.com/photos/0f5XhZUHCc7mOZ4uXJQdQn7eg

@dkackman dkackman mentioned this pull request Feb 12, 2025
@dkackman
Copy link
Contributor Author

closing this one in favor of #329

@dkackman dkackman closed this Feb 15, 2025
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.

BUG when creating offer using only copy/paste
1 participant