Skip to content
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

Visualization: TableLayer: scrolling is sticky and unresponsive #788

Open
TCL735 opened this issue Aug 3, 2022 · 1 comment
Open

Visualization: TableLayer: scrolling is sticky and unresponsive #788

TCL735 opened this issue Aug 3, 2022 · 1 comment
Labels

Comments

@TCL735
Copy link
Contributor

TCL735 commented Aug 3, 2022

When using the TableLayer visualization, scrolling vertically is jarring. The scroll "sticks" and does not move as expected. There is a bounceback to a previous scroll position requiring the user to scroll even harder just to move the scroll position slightly.

Here is a video of the sticky and unresponsive scrolling:

Kapture.2022-08-03.at.14.42.36.mp4
@TCL735 TCL735 added team/ui team/dumplings kind/bug Something isn't working labels Aug 3, 2022
@TCL735 TCL735 changed the title Visualization: TableLayer scrolling is sticky and unresponsive Visualization: TableLayer: scrolling is sticky and unresponsive Aug 4, 2022
@blegesse-w blegesse-w self-assigned this Aug 19, 2022
@blegesse-w
Copy link
Member

Inside TableGraphTable.tsx there is an event listener function handleHover that gets executed each time the mouse moves. In other words, as the mouse hovers over a new cell, this function gets called. handleHover receives an event parameter, which contains a dataset property. And this dataset property we get from the event has a rowIndex property. When user moves the mouse to the first row of the table, rowIndex get updated from it's initial value to 0 -- indicating user is now on the first row of the able. Then when user moves the mouse cursor to the second row of the table, handleHover event listener gets executed and updates the rowIndex to be 1. Each time handleHover runs, we also update a state hoveredColumnIndex and hoveredRowIndex to be +dataset.columnIndex and +dataset.rowIndex respectively. Movement of the mouse from one row to another fireshandleHover function, which updates the state with the dataset.rowIndex value. But because we are updating the state and the state is attached to each cell of the table, it causes the component to re-render. This re-render then executes the handleHover function once again, which ends up updating the state with the previous row index value. Again, when state is updated, each cell gets re-rendered and this time the current row mouse is pointing to gets updated with the correct index value causing the jump we see in the UI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants