text-mask
text-mask copied to clipboard
Fix onChange not Firing when Deleting All Text
When deleting the entire value of a field at once, e.g. cmd+backspace
, onChange is not called. This is most likely due to value
being an empty string, so when the text is deleted the new value is also an empty string, resulting in not raising a change event.
Changing defaultValue
to value
worked for me, but it fails the unit tests. This is just meant as a way to illustrate the problem and hint at a solution. I would appreciate if someone could look into this.
Addresses issue #992
This should be merged. Can someone from the lib authors make a review ?
Waiting for the merge too. Thx
Hello @themzed
Some news on subject ?
I found a similar problem, the initial value is empty and i changed the controlled value but the mask isn't updated on first time.
Hope this fix will solve the pb.
Hello @themzed Something new ?
Hey @FlorianBurgevin, Unfortunately this repo isn't maintained anymore.
@themzed Oh really ? Why ? :(
Yeah, I'm not really up to date about that but it's on the readme file. @FlorianBurgevin
Ok thanks @themzed ! Hope you'll have time later to update some small fixes.
Thanks you too, I'd love to but unfortunately I don't have access to merge PRs @FlorianBurgevin
Have same issue using with Formik. Passing defaultValue prop to MaskedInput solve the problem
<MaskedInput defaultValue={''}