braintree / restricted-input

Restrict <input>s to certain valid characters (e.g. formatting phone or card numbers)
https://braintree.github.io/restricted-input/
MIT License
68 stars 25 forks source link

Provide special strategy for old Android webviews #37

Closed crookedneighbor closed 7 years ago

crookedneighbor commented 7 years ago

Some old android webviews had an issue where characters after a permacharacter could not be inserted. This was because in these environments, the input.value property had not been updated in the event loop when the listener gets called. By delaying the behavior, we get access to the value.

Delaying the formatting breaks it in regular Chrome, so we need a new strategy for these devices.