react-maskedinput icon indicating copy to clipboard operation
react-maskedinput copied to clipboard

fixed so masked input works with chrome auto-fill and on paste

Open axelson opened this issue 9 years ago • 7 comments
trafficstars

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 avatar Mar 02 '16 07:03 axelson

@axelson any response to those qs? That and a rebase and hopefully we can land this.

iamdustan avatar May 06 '16 20:05 iamdustan

Any progress on this? I'd rather not fork this project.

alpjor avatar Jun 14 '16 22:06 alpjor

+1

patrickml avatar Jul 23 '16 02:07 patrickml

@alpjor might be worth checking out https://github.com/Pephers/react-autofill

aesopwolf avatar Dec 15 '16 02:12 aesopwolf

@aesopwolf neat, thanks for link, but I'm pretty conceptually against polling for event listeners if I can help it.

alpjor avatar Dec 15 '16 03:12 alpjor

I published a fork of this PR to npm for the time being https://www.npmjs.com/package/react-maskedinput-autofill

aesopwolf avatar Dec 19 '16 19:12 aesopwolf

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

lassombra avatar Apr 11 '17 18:04 lassombra