Pasting an externally copied negative number into ReactGrid results in a positive number
ypt opened this issue · comments
Describe the bug
- Copy a negative number from an external text editor (e.g. -80 from VsCode)
- Paste that number into ReactGrid
- The number that shows up in ReactGrid is a positive number (e.g. 80)
Expected behavior
The number in ReactGrid should be negative at step 3
Your environment details
- With Chrome 121.0.6167.184 in MacOS
- This can be reproduced here: https://reactgrid.com/examples/?example=budget-planner
@qiufeihong2018, sorry, I'm not seeing your image as a gif animation (I see a static png).
Though, I just tried to reproduce the issue again on the budget planner page, and it seems to be working fine there now. However, I am still able to reproduce on a local project in the same browser with ReactGrid v4.1.3 though.
@ypt What I see is normal, what I cut is png, do you have any abnormal screenshots or gif
Thanks for clarifying, I understand what you're asking for now.
Here's a code sandbox that demonstrates the issue.
https://stackblitz.com/edit/react-playground-practice-wgrfyl?file=index.js
And a screen recording, too
reactgrid-copy-paste-negative-number-example.mov
There appears to be an issue with the regular expression inside the parseLocaleNumber
function. It's currently removing all non-digit characters at the start and end of the string, including the negative sign. Let me fix this issue
Waiting for this fix to be released? Any timeline or other way to handle for now?
Waiting for this fix to be released? Any timeline or other way to handle for now?
The fix has already been released with version 4.1.4