-
Notifications
You must be signed in to change notification settings - Fork 976
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
If VirtualScroll is wrapped inside AutoSize dragging an item doesn't trigger scroll #5
Comments
Managed to solve it by wrapping the <AutoSizer disableHeight>
{({ width }) => (
<SortableList ref="SortableList" items={items} width={width} onSortEnd={this.onSortEnd} />
)}
</AutoSizer> class VirtualList extends Component {
render() {
const { items, width } = this.props;
return (
<VirtualScroll
ref="VirtualScroll"
estimatedRowSize={70}
rowHeight={70}
rowRenderer={({ index }) => {
const { product } = items[index];
return <SortableItem index={index} product={product} />;
}}
rowCount={items.length}
width={width}
height={500}
/>
);
}
} |
Sounds like you've solved this :) |
Hi @ahmedelgabri, it may be the late hour but I can't seem to grok your solution. Thanks! |
Simply the hierarchy for the solution looks like this and width is getting passed from top to bottom, I hope it makes sense.
|
Ah, thanks @ahmedelgabri, I really appreciate your quick answer. I was missing that you apparently also had: const SortableList = SortableContainer(VirtualList, {withRef: true}); Unfortunately, after following the pattern you described, I still have two big problems:
Update: I fixed the first problem by adding a ref to Autosizer: |
Thank you for this Issue thread, it fixed my issue. I suggest adding this to the docs somewhere as I only found this fix thanks to Google after reading through the docs and examples. |
Awesome job @clauderic 馃憤
I'm having a huge list that I'm using
react-virtualized
but if I want the width to be dynamic, for this I must wrap it withAutoSize
You should already know this 馃槉So when I do, I lose the ability to scroll while dragging & item, any hints how to fix this?
The text was updated successfully, but these errors were encountered: