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

[SelectUnstyled] Prevent window scrolling after opening #31237

Merged
merged 1 commit into from Mar 4, 2022

Conversation

michaldudak
Copy link
Member

Changes the implementation of scrolling to the highlighted option. Instead of using scrollIntoView, the listbox scrollTop is calculated and applied if necessary. This ensures only the listbox content is scrolled, not the entire window (or other external scroll container).

Fixes #31010

@michaldudak michaldudak added component: select This is the name of the generic UI component, not the React module! package: base-ui Specific to @mui/base labels Feb 28, 2022
@mui-bot
Copy link

mui-bot commented Feb 28, 2022

Details of bundle changes

Generated by 🚫 dangerJS against e33d538

Copy link
Member

@mnajdova mnajdova left a comment

Choose a reason for hiding this comment

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

I've tested this on the same repository as in the issue and am confirming it works 👍

@michaldudak michaldudak merged commit a492105 into mui:master Mar 4, 2022
@michaldudak michaldudak deleted the selectunstyled-scroll branch March 4, 2022 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: select This is the name of the generic UI component, not the React module! package: base-ui Specific to @mui/base
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[SelectUnstyled] The pages scrolls when select is opened
3 participants