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

Fails with Safari Credit Card Autofill #111

Closed
dwbruhn opened this issue Sep 26, 2017 · 2 comments · Fixed by #112
Closed

Fails with Safari Credit Card Autofill #111

dwbruhn opened this issue Sep 26, 2017 · 2 comments · Fixed by #112

Comments

@dwbruhn
Copy link
Contributor

dwbruhn commented Sep 26, 2017

Hi, thanks for the awesome component!

It doesn't appear to handle Safari Credit Card Autofill correctly, however. I've created a small demo app to reproduce the problem:

https://github.com/dwbruhn/mask-test

Some initial debugging points to the _onChange method, which isn't really editing the mask.

@dwbruhn
Copy link
Contributor Author

dwbruhn commented Sep 27, 2017

Just to follow up: If I'm understanding the code correctly, the bug seems to reside in the design that handles all data-adding edits in _onKeyPress and _onPaste, leaving _onChange to handle only Cut & Delete operations.

The problem is that Autofill provides the input data only in an onchange event, and _onChange simply discards that data.

@dwbruhn
Copy link
Contributor Author

dwbruhn commented Sep 27, 2017

So a possible fix would be to remove the assumption that onchange events only involve cut operations and handle actual data changes in _onChange. But note that this would slightly change the behavior of cutting and deleting.

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 a pull request may close this issue.

1 participant