Skip to content

ref(nav) fix keyboard scroll#111152

Merged
JonasBa merged 2 commits intomasterfrom
jb/ref/focus-visible
Mar 19, 2026
Merged

ref(nav) fix keyboard scroll#111152
JonasBa merged 2 commits intomasterfrom
jb/ref/focus-visible

Conversation

@JonasBa
Copy link
Member

@JonasBa JonasBa commented Mar 19, 2026

Fixes an issue with secondary navigation where page scroll was triggered during keyboard navigation

@JonasBa JonasBa requested a review from a team as a code owner March 19, 2026 20:42
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Mar 19, 2026
}

:hover [data-reorderable-handle-slot] {
:hover [data-reorderable-handle-slot],
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small fix to the visibility of the handle

Copy link
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Copy link
Member

@natemoo-re natemoo-re left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately doesn't seem to stop the page scroll
https://github.com/user-attachments/assets/cd73eb4d-3a39-4d12-893f-77453e256454

Replace the manual ref + capture-phase keydown listener with
useScrollLock(document.body) to prevent page scroll during keyboard-driven
drag-and-drop in the secondary navigation reorderable list.

The previous implementation was also broken: the useEffect checked
isKeyboardDraggingRef.current at mount time (always false), so the
arrow-key scroll prevention listener was never actually registered.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Member

@natemoo-re natemoo-re left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, it's working with the scroll lock!

@JonasBa JonasBa merged commit 998253c into master Mar 19, 2026
69 checks passed
@JonasBa JonasBa deleted the jb/ref/focus-visible branch March 19, 2026 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants