reactgrid icon indicating copy to clipboard operation
reactgrid copied to clipboard

Selection Delay on Large Sheets

Open bessaapps opened this issue 1 year ago • 4 comments

There seems to be a delay when selecting cells on large sheets

If you click a cell it takes a second to select. Furthermore, you can't start dragging until the cell is selected.

I want to select a cell, column, or row with the cursor or keyboard shortcuts in a large file with minimum delay.

Desktop/laptop iOS Chrome

bessaapps avatar Feb 12 '25 14:02 bessaapps

@bessaapps Excuse me, how large is the data volume? Is virtual scrolling used?

qiufeihong2018 avatar Feb 14 '25 06:02 qiufeihong2018

the file sizes vary from 10k - 20k.

I'm using a setState inside the handler for when cells/rows are selected and there's a huge delay.

as far as I know, the grid is virtualized already. (there doesn't be an issue scrolling.)

bessaapps avatar Feb 14 '25 18:02 bessaapps

update:

when settings state for my checkboxes from the checkbox cell, a custom checkbox cell, or the selection handler it lags big time. i commented out the grid and put a very simple unvirtualized example on top of it and i can toggle checkboxes just fine. mind you this is with, i think, about 20,000 rows.

{filteredRows?.map((filteredRow) => ( <div onClick={() => setFilteredRows((prev) => prev?.map((item) => item?._id === filteredRow?._id ? { ...item, isChecked: !item.isChecked } : item ) ) } > {filteredRow?._id}&nbsp;&nbsp;&nbsp; {filteredRow?.isChecked ? "t" : "f"} </div> ))}

i've noticed, at least in the selection handler, that i can log the first clicked rowId quickly and the last rowId quickly. but if i put a setState after the first log it takes forever to render the set state and update the ui. i thought maybe it was something with setState but the above example proves that wrong.

what might be blocking these setState from running when using these provided handlers???

bessaapps avatar Feb 16 '25 20:02 bessaapps

Hi, did you manage to fix the issue?

mohamed161001 avatar May 03 '25 22:05 mohamed161001