-
Notifications
You must be signed in to change notification settings - Fork 197
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
fixed so masked input works with chrome auto-fill and on paste #32
base: master
Are you sure you want to change the base?
Conversation
Edit: Rebased onto latest master Only kept relevant change. Change to dist was dropped to help avoid merge conflicts Add phone number example to demo page
@@ -146,6 +147,14 @@ var MaskedInput = React.createClass({ | |||
setTimeout(this._updateInputSelection, 0) | |||
this.props.onChange(e) | |||
} | |||
else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you educate me on why the if (this.mask.paste(e.clipboardData.getData('Text')) {...}
part just before this block returns falsy and falls through to this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The falsy return happens here https://github.com/insin/inputmask-core/blob/master/lib/index.js#L374-L393 on line 391. I'm not exactly sure what that means, but I can dive into it more if need be.
@axelson any response to those qs? That and a rebase and hopefully we can land this. |
Any progress on this? I'd rather not fork this project. |
+1 |
@alpjor might be worth checking out https://github.com/Pephers/react-autofill |
@aesopwolf neat, thanks for link, but I'm pretty conceptually against polling for event listeners if I can help it. |
I published a fork of this PR to npm for the time being https://www.npmjs.com/package/react-maskedinput-autofill |
Trying to use the published version from npm pushed out by @aesopwolf I discovered a minor bug. If the paste falls through to the second paste method, onChange never fires. I fixed that in https://github.com/lassombra/react-maskedinput so that I could use this, However I'm unsure how you would like to handle this as that would effectively be a pull request of a pull request... Specifically this is fixed in this commit: lassombra@b760ed2 |
Fixes issue #21
Edit:
Rebased onto latest master
Only kept relevant change. Change to dist was dropped to help avoid
merge conflicts
Add phone number example to demo page
Test code (add to demo/index.html):