react-input-mask icon indicating copy to clipboard operation
react-input-mask copied to clipboard

Optional character in the middle (or prefix|suffix word)

Open adhenrique opened this issue 5 years ago • 4 comments

Has anyone come across something like that? I tried to create a mask that contemplates 123 hours or 1234 hours, but it seems not to work well:

const formatChars = {
  "9": "[0-9]",
  "?": "[0-9 ]"
};
const mask = value.length <= 9 ? "999? hours" : "9999 hours";

When I type 123, it would be correct for the library to fill the rest of the field with hours, but it only fills if I type 1234.

Is my logic incorrect?

adhenrique avatar Aug 13 '19 01:08 adhenrique

Any update on this issue? I have the same problem. In the old version, works fine.

lucaashrq avatar Oct 12 '19 13:10 lucaashrq

up

annezao avatar Apr 15 '20 00:04 annezao

up

3runoDesign avatar Aug 18 '20 14:08 3runoDesign

Any update on this issue? I have the same problem

lcsflrs avatar Sep 04 '20 20:09 lcsflrs