inovua / reactdatagrid

Empower Your Data with the best React Data Grid there is
https://reactdatagrid.io
Other
3.44k stars 57 forks source link

The cursor position cannot change when use Cleave in renderEditor. #323

Open zhangmengjie-amy opened 1 year ago

zhangmengjie-amy commented 1 year ago

Problem description:

For example: image

The original value of the cell is -1000.000, I double click it to start edit, firstly I put cursor between 1 and 0, and input 234, so the result is -1234000.000, and then I want to change the cursor position through click, I click between – and 1, but the cursor position cannot change, it is still between 4 and 0. And I use this Cleave in another place, not in renderEditor of ReactDataGrid, the cursor work well.

Reproduce the issue in codesandbox here: https://codesandbox.io/s/amy-zhang-xuitu3?file=/src/App.js In this link, you can enter 123 after double click a cell, and then put the cursor between 1 and 2 by click, and then enter 111, now put cursor between 2 and 3, you will find the cursor position can not change.