Skip to content

useCellRangeSelection fails with virtualization #22

@danvln

Description

@danvln

Hey,

First of all, this is a great hook! Thanks for providing it - all the appreciation for your work.

I tried the useCellRangeSelection with virtualization, I have enabled in my POC project both: react-window and react-virtual, but for both of them the hook is failing.

Error details:

Error: React Table: startCellId and endCellId has to be valid cell Id

Code path:

// Returns all cells between Range ( between startcell and endcell Ids)
const getCellsBetweenId = React.useCallback(
(startCell, endCell) => {
if (!cellsById[startCell] || !cellsById[endCell]) {
console.info({ startCell, endCell })
throw new Error(
React Table: startCellId and endCellId has to be valid cell Id
)
}

I was expecting the cells to be used from the object that's still in memory and not from the rendering objects that are dropped. But since I am new to these hooks I might miss something.

Thanks again.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions