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

copy -> paste - incorrect inserted values into NumberCell

890f2151c2be69c51db72017546d00fd opened this issue · comments

Describe the bug
some values are copied into NumberCell as 0 instead of NaN
its impossible distinguish if copied value was 0 or text
nanToZero property is set to false and I can edit and remove cell value => cell is empty and value is NAN

Current behavior
222 is inserted as 222 => correct
0 is inserted as 0 => correct
'Hello' is inserted as 0 => incorrect
'' is inserted as 0 => incorrect

Expected behavior
'Hello' should be inserted into NumberCell as NaN
'' should be inserted into NumberCell as NaN

Screenshots or gifs
If applicable, add screenshots to help explain your problem.

Your environment details
macbook m1, lates chrome, copied from excell for mac 16.83
not tested on windows

or can i intercept inserting with custom function or set up that text inserted into NumberCell will be NaN?

Please give me a online demo?

https://stackblitz.com/edit/vitejs-vite-3ptweg?file=src%2FApp.tsx

when i copy empty cell or cell with text from excell and paste it. its pasted as 0

negative values are not pasted as negative as well
e.g. -1 copied from excel or text editor is pasted as 1 into the grid

@webloopbox

agree:
'Hello' should be inserted into NumberCell as NaN
'' should be inserted into NumberCell as NaN

This bug has been fixed here: #384

commented

@MichaelMatejko Seems to have been solved, this issue can be closed

thank you for fixes, it works like expected now