Closed cetetesoft closed 2 months ago
HI @cetetesoft Can I ask you to provide stackblitz example with described behavior https://stackblitz.com/edit/table-many-rows-ts?file=Demo.tsx ?
Sure, @komarovalexander . Here you are: https://stackblitz.com/edit/table-many-rows-ts-8seuhl?file=Demo.tsx
The demo will start with the cell (1;10)
selected. The visible rows are 0 through 11. After pressing ArrowDown
twice, the table wrapper will scroll down, showing rows 7 to 18. Regarding this behavior, could it be changed somehow to scroll by one row - ie showing rows 1 to 12, then 2 to 13, and so on?
Now, from this point (having the cell (1;12)
selected and visible rows spanning from 7 to 18), if you press ArrowUp
repeatedly, you'll notice you can't go any further than cell (1;7)
. The table wrapper won't scroll up and the selected cell is apparently stuck on row 7. However, if you press ArrowUp
N times, you'll need to press ArrowDown
N times again to get back to the cell above. This suggests the selected row may be actually being decreased with each keystroke, but it doesn't update the view accordingly.
I have tested this demo in both Chrome and Firefox with the same result.
Hi @cetetesoft
Regarding this behavior, could it be changed somehow to scroll by one row - ie showing rows 1 to 12, then 2 to 13, and so on?
im afraid this is default behavior of html table, see example https://stackblitz.com/edit/table-keyboard-navigation-ts-prknhj?file=Demo.tsx click by cell and change focus using "Tab" key
@cetetesoft
if you press ArrowUp N times, you'll need to press ArrowDown N times again to get back to the cell above
maybe it is not so obvious, but there are no rendered rows above, so you cant move the focus further. To fix that there is topInvisibleCount
option in virtualScrolling
so you can enable some items above visible line to be rendered as well. In this way ArrowUp will work https://stackblitz.com/edit/table-many-rows-ts-276fys?file=Demo.tsx
Hi.
I have one bug report and one enhancement suggestion regarding the scrolling behavior for virtualized rows.
When calling
table.moveFocusedUp()
, if the current cell is on top (ie from the 1st visible row), the table wrapper won't scroll up. This behavior is different from that oftable.moveFocusedDown()
for the last visible cell. In addition, the cell keeps the:focus-within
style, even though I can tell it's not actually the active cell.Steps to reproduce:
<tr>
with theheight
attribute).ArrowUp
key several times.ArrowDown
key several times. You'll need to press it as many times asArrowUp
.Additionally, it would be nice for the scroll down behavior to more consistent. Right now, if you press
ArrowDown
having the last visible row selected, it will scroll the table by one row only if the last row is completely visible. When that row is partially visible, however, the table will scroll by about 50% of the visible height. Could this be customized in some way, like, scrolling just one row in all cases (like spreadsheet software such as Excel does)?Thanks.