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

negative sign can not be deleted when `prefix` is more than one symbol

Open VanemalP opened this issue 10 months ago • 0 comments

Describe the issue and the actual behavior

  • When allowNegative is set to true and the prefix prop contains more than one symbol (e.g., "USD"), the user cannot delete the negative sign using the backspace key when there is a negative input.
  • Additionally, if only a negative sign is input, it gets removed when the input loses focus (on blur).

Describe the expected behavior

Users should be able to delete the negative sign using the backspace key.

Provide a CodeSandbox link illustrating the issue

https://codesandbox.io/p/sandbox/multi-symbol-prefix-with-negative-qvqnfh

Provide steps to reproduce this issue

  1. Open the provided CodeSandbox link
  2. Attempt to delete the value including the negative sign by pressing the backspace key.
  3. Observe that the negative sign is not deleted.
  4. Blur the input field
  5. Observe that the negative sign is removed

Please check the browsers where the issue is seen

  • [x] Chrome
  • [ ] Chrome (Android)
  • [ ] Safari (OSX)
  • [ ] Safari (iOS)
  • [ ] Firefox
  • [ ] Firefox (Android)

VanemalP avatar Feb 05 '25 08:02 VanemalP