-
Notifications
You must be signed in to change notification settings - Fork 196
fixed so masked input works with chrome auto-fill and on paste #32
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -71,6 +71,7 @@ var MaskedInput = React.createClass({ | |
| this.mask.selection.end = this.mask.selection.start + sizeDiff | ||
| this.mask.backspace() | ||
| } | ||
| this.mask.setValue(e.target.value); | ||
| var value = this._getDisplayValue() | ||
| e.target.value = value | ||
| if (value) { | ||
|
|
@@ -146,6 +147,14 @@ var MaskedInput = React.createClass({ | |
| setTimeout(this._updateInputSelection, 0) | ||
| this.props.onChange(e) | ||
| } | ||
| else { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you educate me on why the
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
| this.mask.setValue(e.clipboardData.getData('Text')); | ||
| var value = this._getDisplayValue() | ||
| e.target.value = value | ||
| if (value) { | ||
| this._updateInputSelection() | ||
| } | ||
| } | ||
| }, | ||
|
|
||
| _getDisplayValue() { | ||
|
|
||
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.
Is the value here expedcted to be what is set as
e.target.valueon L#153?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.
It seems like it. @axelson would you mind chiming in?