Skip to content

Commit 6e23c9a

Browse files
authored
Stop page from scrolling up when moving resizer with left/right arrow keys (#3786)
1 parent 8f2f2ac commit 6e23c9a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/@react-spectrum/table/src/TableView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ function TableVirtualizer({layout, collection, lastResizeInteractionModality, fo
425425

426426
useEffect(() => {
427427
if (lastResizeInteractionModality.current === 'keyboard' && headerRef.current.contains(document.activeElement)) {
428-
document.activeElement?.scrollIntoView?.(false);
428+
document.activeElement?.scrollIntoView?.({block: 'nearest', inline: 'nearest'});
429429
bodyRef.current.scrollLeft = headerRef.current.scrollLeft;
430430
}
431431
}, [state.contentSize, headerRef, bodyRef, lastResizeInteractionModality]);

0 commit comments

Comments
 (0)