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

[Bug]: Scroll jump when navigating nested tree using keyboard #31557

Closed
2 tasks done
miroslavstastny opened this issue Jun 4, 2024 · 0 comments · Fixed by #31577
Closed
2 tasks done

[Bug]: Scroll jump when navigating nested tree using keyboard #31557

miroslavstastny opened this issue Jun 4, 2024 · 0 comments · Fixed by #31577

Comments

@miroslavstastny
Copy link
Member

Library

React Components / v9 (@fluentui/react-components)

System Info

--

Are you reporting Accessibility issue?

None

Reproduction

https://stackblitz.com/edit/4tp1ua-c6neih?file=src%2Fexample.tsx

Bug Description

Actual Behavior

  • Use nested tree with a lot of items
  • Navigate the items using keyboard
  • The scroll "randomly jumps" when navigating among the items
  • When the focused item is out of view, it is scrolled into view. Sometimes, the focused tree item is scrolled to the center of the viewport. That is browser behavior and should not be a surprise for users.

The problem appears once you focus any tree item which has a subtree.

We are focusing the TreeItem itself, not the TreeItemLayout.
The TreeItem contains all its subtree.
At this moment the browser does its best to fit the focused item (whole subtree) into the view and that causes the jump

Expected Behavior

No perceived jumpiness during scroll.

Screen.Recording.2024-06-03.at.5.08.10.PM.mov

Logs

No response

Requested priority

Blocking

Products/sites affected

No response

Are you willing to submit a PR to fix?

no

Validations

  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • The provided reproduction is a minimal reproducible example of the bug.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants