Commit f3eb538
fix: keyboard navigation to last row/column enables sticky scrolling (#2562)
Fix keyboard shortcuts to end of table to apply stuckToBottom
**Problem:**
When using `Ctrl+End` or `Ctrl+ArrowDown` (mac: `Cmd` instead) to scroll
to the bottom of a ticking table, the viewport moves to show the last
row but does not enable `isStuckToBottom`. This means the table doesn't
continue tracking new rows as they are added.
**Solution:**
Fixed `getTopForBottomVisible()` and `getLeftForRightVisible()` in
`GridMetricCalculator` to account for scrollbar space, making them
return the same values as `lastTop`/`lastLeft` when navigating to the
last row/column which is used to determine if `isStuckToBottom`.
**Changes:**
- Modified `getTopForBottomVisible()` to deduct `scrollBarSize` from
available height
- Modified `getLeftForRightVisible()` to deduct `scrollBarSize` from
available width
- Added unit tests verifying sticky bottom behavior with keyboard
shortcuts
- Updated e2e test snapshots to reflect new expected visual behavior
- All grid tests pass
- Manually checked keyboard shortcut sticks to bottom of a time-table
Keyboard navigation now properly triggers `isStuckToBottom` by scrolling
to the maximum position that matches `lastTop`/`lastLeft`.
Fixes #2361
---------
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: dsmmcken <[email protected]>
Co-authored-by: Don McKenzie <[email protected]>1 parent 8b23c8a commit f3eb538
File tree
5 files changed
+88
-4
lines changed- packages/grid/src
- tests/table-scroll.spec.ts-snapshots
5 files changed
+88
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
935 | 935 | | |
936 | 936 | | |
937 | 937 | | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
938 | 1017 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
919 | 919 | | |
920 | 920 | | |
921 | 921 | | |
922 | | - | |
| 922 | + | |
| 923 | + | |
923 | 924 | | |
924 | 925 | | |
925 | | - | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
926 | 929 | | |
927 | 930 | | |
928 | 931 | | |
| |||
958 | 961 | | |
959 | 962 | | |
960 | 963 | | |
961 | | - | |
| 964 | + | |
| 965 | + | |
962 | 966 | | |
963 | 967 | | |
964 | | - | |
| 968 | + | |
| 969 | + | |
965 | 970 | | |
966 | 971 | | |
967 | 972 | | |
| |||
0 commit comments