s-yadav / react-number-format

React component to format numbers in an input or as a text.
MIT License
3.9k stars 410 forks source link

Impossible to unselect input if using prefix of length greater than one #862

Open simzikov opened 1 month ago

simzikov commented 1 month ago

Say you have a numeric input with a prefix that has more than one symbol:

<NumericFormat value={1234} prefix={"$$"} />

Try focusing it with a Tab key or using your mouse and pressing Cmd + A to select its content. Once its content is selected, it is not possible to unselect it using arrow keys (Left/Right).

Playground: https://codesandbox.io/p/sandbox/hzcwz2

Used to work OK in at least version v5.2: https://codesandbox.io/p/sandbox/prefix-demo-forked-cp5d8c?from-embed=&workspaceId=549a3a30-4c49-4cb4-8e8b-cf3d73a2df19