react-number-format icon indicating copy to clipboard operation
react-number-format copied to clipboard

format props: Cursor moving to beginning by pressing "backspace"

Open IhorFedorkiv94 opened this issue 5 years ago • 3 comments

format_props

Created a custom format, pre-filling at the beginning formatted string with "+" and code country.

After manipulation, I receive string - "+93-##-###-####"

Moving the cursor at the beginning by pressing "backspace". when you start typing from that position - additional duplicate prefix symbols appear. <NumberFormat /> - using inside Formik and Material UI

<NumberFormat
  {...other}
  getInputRef={(i: HTMLInputElement) => {
    numberFormatInput = i;
  }}
  onValueChange={(values) => {
    onChange({
      target: {
        value: values.value
      }
    });
  }}
  allowEmptyFormatting
  isNumericString
  format={customInputFormat}
  mask="_"
  type="tel"
/>

NOTE:
With spacing after numbers work well. Without spacing or with a dash after numbers works, not as expected. format_props_two

IhorFedorkiv94 avatar Jun 16 '20 11:06 IhorFedorkiv94

Looks like a bug. Will check.

s-yadav avatar Dec 06 '20 19:12 s-yadav

This bug is still continue. Anyone have background solution?

mperk avatar Feb 03 '22 13:02 mperk

this issue looks like the same strange behaviour, like in https://github.com/s-yadav/react-number-format/issues/572

fruitbang avatar Jun 20 '23 20:06 fruitbang