I made this implementation to handle Brazilian phone numbers. But it is necessary to use this function in a normal "input" instead of "InputMask". This function must be passed in the "onKeyPress" of the input. It worked fine for me, and also works with copy and paste commands.
I made this implementation to handle Brazilian phone numbers. But it is necessary to use this function in a normal "input" instead of "InputMask". This function must be passed in the "onKeyPress" of the input. It worked fine for me, and also works with copy and paste commands.
Originally posted by @EriJohnson in https://github.com/sanniassin/react-input-mask/issues/190#issuecomment-817376306