react-maskedinput
react-maskedinput copied to clipboard
fixed so masked input works with chrome auto-fill and on paste
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):
<form method="post">
First name: <input type="text" name="fname" />
Last Name: <input type="text" name="lname" />
<div className="form-field">
<label htmlFor="phone">Phone Number:</label>
<MaskedInput mask="(111) 111-1111" name="phone" id="phone" onChange={this._onChange} placeholder="(999) 999-9999"/>
</div>
@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: https://github.com/lassombra/react-maskedinput/commit/b760ed2401bd3d748885becaf9a65ed2e77e4ae4