silevis / reactgrid

Add spreadsheet-like behavior to your React app

Home Page:https://reactgrid.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pasting an externally copied negative number into ReactGrid results in a positive number

ypt opened this issue · comments

Describe the bug

  1. Copy a negative number from an external text editor (e.g. -80 from VsCode)
  2. Paste that number into ReactGrid
  3. 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

@ypt I have a normal, abnormal gif?
image

@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

@ypt ok

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