react-currency-input-field icon indicating copy to clipboard operation
react-currency-input-field copied to clipboard

fr-CA locale causes cursor and currency sign to jump around

Open kevin-cho opened this issue 2 years ago • 0 comments

Describe the bug fr-CA is Canadian French and when used as the locale for the intlConfig prop, it should use a comma to separate the dollar and cents. Also the dollar sign should be a suffix on the far right. But when deleting digits and adding the comma, the cursor and the dollar sign will jump around unexpectedly.

To Reproduce Steps to reproduce the behavior:

  1. Go to https://codesandbox.io/s/agitated-mcclintock-0vg43l?file=/src/App.js
  2. Click on the input at the end, to the right of the dollar sign
  3. Press backspace, the cursor doesn't move
  4. Try clicking to the right of the cents (i.e. the 0 digit) and backspacing a couple times

Expected behavior Backspacing in the input should delete digits and keep the currency sign to the right at all times. Should be able to enter a comma to separate dollars and cents and be able to enter said dollars and cents without the currency sign jumping around.

Code Sandbox https://codesandbox.io/s/agitated-mcclintock-0vg43l?file=/src/App.js

kevin-cho avatar Jul 06 '22 20:07 kevin-cho