I have any table with 200 rows and when I scroll down very quickly with ArrowDown
the focus of the row it goes up a lot and sometimes it gets lost because it stays very high, I need that when I scroll down the focus stays in the center of the table when the focus goes through the center.
As you can see in the GIF the focus does not stay in the center, up or down. I need him to stay downtown, obviously when he gets there.
I'll explain a bit about how it works... it listens to the keyboard all the time, when it receives the ArrowDown(40) or ArrowUp(38) key first it doesn't allow it to scroll down by default like most browsers do. After that it gets the ID of the previous row and adds or subtracts one to it so that it is positioned in the next or previous row, after that it tells it which row I just focused on and also if it was when the "ArrowUp" key was pressed or "ArrowDown". Once this is done, the method will look for the table and will get the number of rows it has and will also get the height of the selected row to be able to use that height in the scroll, after that the method evaluates and if it fulfills it will do the necessary scroll.
You will need a table that contains their IDs in an ordered way.
And a method that gets its ID when it changes rows: