Skip to content

Stub out Virtualized Grid Example #326

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
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

blord-fullscreen
Copy link

Hi @clauderic, I am trying to get this working with react-virtualized <Grid>. I am running into an issue I'm hoping you can spot and address. In hopes of tempting you to help me out, I've stubbed out an illustrative example in the storybook demo page 😸 which I hope can be tweaked and added to the repo for future purposes.

Basically, everything works, except that drag-scrolling down long distances generates errors in the console. The error is easy to reproduce. Run the demo locally, click on the . "Virtualized Grid" example, and drag scroll down, hard and fast. The error happens here:

https://github.com/clauderic/react-sortable-hoc/blob/master/src/SortableContainer/index.js#L681

I would be extremely grateful for a fix to this. Thanks for an awesome library.

@jfrolich
Copy link

It looks to work for me. The only issue here is that the ordering seems to be unstable, if you drag and pause, the items shift. This does not happen if you keep the mouse 'wiggling'. Example below (gif):

2018-07-17 18 00 25

cellRenderer={({columnIndex, key, rowIndex, style}) => {
const datumIndex = (rowIndex * COLUMN_COUNT) + columnIndex;

const {value, height} = items[datumIndex];
Copy link

@peterhorne peterhorne Sep 27, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't handle the case when datumIndex is greater than the number of items.

@chaomao
Copy link

chaomao commented Nov 27, 2020

https://codesandbox.io/s/dazzling-rhodes-q6jku, a simple demo

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

Successfully merging this pull request may close these issues.

4 participants