Skip to content

Scroll issue when navigation with keyboard #8148

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

Closed
nakah opened this issue Apr 25, 2025 · 5 comments
Closed

Scroll issue when navigation with keyboard #8148

nakah opened this issue Apr 25, 2025 · 5 comments

Comments

@nakah
Copy link

nakah commented Apr 25, 2025

Provide a general summary of the issue here

RadioGroup, CheckBoxGroup and Switch components are behaving strangely when used navigating with Tab key on page where "overflow: hidden" has been set on html element.
The browser (Edge) doesn't scroll onto the component and also creates a blank space at the bottom. On Firefox, the blank space is not created but it doesn't scroll onto the component.

🤔 Expected Behavior?

Should scroll into components

😯 Current Behavior

It's not scrolling into components and display issues on Edge

💁 Possible Solution

I don't know what's happening exactly, but I noticed that scrollTop value for html tag is added (which shouldn't be the case as it's overflow is hidden)

🔦 Context

No response

🖥️ Steps to Reproduce

Here is a Code Sandbox : Link

Open the link and navigate using Tab key. From TextField to Button component, it's working. Then navigating to RadioGroup, Switch or CheckBoxGroup it's broken.

Image

Image

Image

Version

1.8.0

What browsers are you seeing the problem on?

Microsoft Edge, Firefox

If other, please specify.

No response

What operating system are you using?

Windows 11

🧢 Your Company/Team

No response

🕷 Tracking Issue

No response

@yihuiliao
Copy link
Member

This might be fixed by #8091. Will double check with the team member who worked on this when they're back and see if that is the case.

@yihuiliao
Copy link
Member

yihuiliao commented May 6, 2025

Seems like that PR has been merged. Mind checking if it resolves your use case?

@nakah
Copy link
Author

nakah commented May 7, 2025

I reproduced it with the latest version available (1.8.0). If this PR is in this release then the issue is not fixed.

@yihuiliao
Copy link
Member

Apologies, I should've specified to use the nightlies. Also, I realized that the PR above only affects S2 components but you are using RAC. That said, I think you'll need to take a similar approach as that PR and apply position relative to the RadioGroup, Switch, and CheckboxGroup to fix your issue. See codesandbox

@nakah
Copy link
Author

nakah commented May 12, 2025

Thanks! I applied "position: relative" and it worked.

@nakah nakah closed this as completed May 12, 2025
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

2 participants