You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working on a spreadsheet like application, The layout is similar to this https://bvaughn.github.io/react-virtualized/#/components/ScrollSync
I need to synchronize the vertical and horizontal offsets of the Grid with the header and first column components, When the smooth scrolling feature(chrome://flags/#smooth-scrolling) is enabled in the browser, or when the smooth scrolling option is enabled for the mouse (supported by hardware drivers). Because the onChange event may not be triggered promptly, it can lead to a tearing sensation between the scrolling area and other components.
Now I manually monitor the scrolling behavior of the component and then get the scrollOffset of the scrolling component, and then synchronize it to other components. It seems to work fine. I want to know if there is something wrong with my approach, and is there a better way? Maybe the onChange event is not for this scenario?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm working on a spreadsheet like application, The layout is similar to this https://bvaughn.github.io/react-virtualized/#/components/ScrollSync
I need to synchronize the vertical and horizontal offsets of the Grid with the header and first column components, When the smooth scrolling feature(chrome://flags/#smooth-scrolling) is enabled in the browser, or when the smooth scrolling option is enabled for the mouse (supported by hardware drivers). Because the onChange event may not be triggered promptly, it can lead to a tearing sensation between the scrolling area and other components.
Now I manually monitor the scrolling behavior of the component and then get the scrollOffset of the scrolling component, and then synchronize it to other components. It seems to work fine. I want to know if there is something wrong with my approach, and is there a better way? Maybe the onChange event is not for this scenario?
Beta Was this translation helpful? Give feedback.
All reactions