alexkuz/react-input-enhancements

Mask doesn't handle pasting values that make the value too long for the mask

bloodyowl opened this issue · 0 comments

behaviour

In the credit card example:

  • Type 123456789012
  • Write 12345 somewhere else, copy it
  • Paste after the 2 already in the field
  • Value isn't updated

expected

  • Value should be updated

Not sure what the behaviour should be exactly, I'd intuitively say that appending pastedValue.slice(0, maxLength - currentValueLength) to the value should work