Description
I have a potentially long list of items rendered in a react-virtualized VirtualScroll
.
Each item (row) in the list has a fairly large amount of elements, one of which opens a context menu. I'm trying to use react-tether
to render that menu on the HTML body
(so that it's not hidden when the item is at the bottom/top of the scrollable list) and keep the menu 'stuck' to my item while the user scrolls through the list.
My problem is that there is a noticeable lag in updating the position of the tethered menu.
Some of the steps I've taken so far:
- Rendered a simple list, without
VirtualScroll
. The tethered menu was rendered smoothly, no noticeable jank. That's how I concluded that the problem is withreact-virtualized
- Simplified my
rowRenderer
down to only the menu trigger, as recommended here. - Implemented
shouldComponentUpdate
in the row component. This has improved the perceived performance greatly, reduced the delay greatly but it is still noticeable. - Checked Chrome devtools' timeline. I see reflows triggered by both
Grid.js
andtether.js
.
Library Versions:
- react-virtualized v. 7.24.3 (Large project, not ready to make the step to 8.x yet)
- react-tether v. 0.5.2
- react v. 15.2.1
Working Demo
https://plnkr.co/edit/f7OhCoCXkDsWbyjxhR3f
Screenshot: