Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FocusScope] Doesn't scroll to a focusable element in an overflow container #3227

Open
jaknas opened this issue Nov 13, 2024 · 0 comments
Open

Comments

@jaknas
Copy link

jaknas commented Nov 13, 2024

Bug report

Current Behavior

When there is an interactive element (e.g link) placed in an overflow container, focusing on it doesn't scroll it into view.

Expected behavior

I'd expect the link to be scrolled into view, just as in the native browser behavior (at least in Chrome and Firefox).

Reproducible example

https://codesandbox.io/p/devbox/radix-focusable-element-in-scrollable-container-v9wly2

  1. Open the dialog
  2. Tab so the link becomes focused
  3. Notice that the link is not being scrolled into view.

Suggested solution

Turn off preventScroll for this case. Patching this line manually seems to fix the problem.

Additional context

Judging by the comment above the line linked above, I'm wondering if this was not thought-of, or deliberate action?

Your environment

Software Name(s) Version
Radix Package(s) radix-dialog latest
React n/a 18
Browser Chrome latest
Assistive tech
Node n/a
npm/yarn
Operating System MacOs 14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant