Skip to content

Selection Delay on Large Sheets #497

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
bessaapps opened this issue Feb 12, 2025 · 4 comments
Open

Selection Delay on Large Sheets #497

bessaapps opened this issue Feb 12, 2025 · 4 comments

Comments

@bessaapps
Copy link

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

@qiufeihong2018
Copy link
Contributor

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

@bessaapps
Copy link
Author

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
Copy link
Author

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???

@mohamed161001
Copy link

Hi, did you manage to fix the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants