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

[ScrollArea] Handle visibility change and nesting #1598

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

atomiks
Copy link
Contributor

@atomiks atomiks commented Mar 24, 2025

When using ScrollArea inside Select, all the wrappers need role="presentation" to not interfere with the listbox role.

Further, the thumb was not computed when the ScrollArea became visible, and incorrectly reset the scrollbar offset if it had no width/height (such as on hide/unmount).

https://deploy-preview-1598--base-ui.netlify.app/experiments/scroll-area/inside-select

@atomiks atomiks added the component: scroll area This is the name of the generic UI component, not the React module! label Mar 24, 2025
Copy link

netlify bot commented Mar 24, 2025

Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit 0329bb3
🔍 Latest deploy log https://app.netlify.com/sites/base-ui/deploys/67f4be1407442000084918d2
😎 Deploy Preview https://deploy-preview-1598--base-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Apr 1, 2025
Signed-off-by: atomiks <cc.glows@gmail.com>
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Apr 1, 2025
@michaldudak
Copy link
Member

There's an issue when the viewport is resized while the Select is open. Once the viewport edge reaches the thumb, the native scrollbar appears.

select-scroll.mov

@atomiks
Copy link
Contributor Author

atomiks commented Apr 7, 2025

@michaldudak updated - looks like that's just because overflow-y: auto is on .Popup in the experiment, but should be removed when using ScrollArea inside of it

@atomiks atomiks force-pushed the fix/scroll-area-hide-nesting branch from 608f838 to ffbbf54 Compare April 7, 2025 01:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: scroll area This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants