-
-
Notifications
You must be signed in to change notification settings - Fork 110
[ScrollArea] Handle visibility change and nesting #1598
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
Conversation
✅ Deploy Preview for base-ui ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Signed-off-by: atomiks <[email protected]>
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 |
@michaldudak updated - looks like that's just because |
608f838
to
ffbbf54
Compare
Now the scrollbar appears on the viewport: bad.mp4Instead of recalculating the thumb position: good.mp4(https://codesandbox.io/p/sandbox/hopeful-babycat-nvh9pq?file=%2Fsrc%2FApp.tsx) |
@michaldudak I can't repro the first one on macOS with the scrollbars always visible setting - is it also visible on the current v1.0.0-alpha.7? Second one, I can |
The second video shows alpha.7 |
@michaldudak Oh right, I thought you meant it was a second issue not recalculating the position. But it seems like they're related: because it doesn't recalculate the position it overflows the bottom and causes the main scrollbar to appear. Seems like that's due to the |
Sorry I wasn't clear enough! It seems to work well now. I'll do a final pass of the implementation now. |
When using ScrollArea inside Select, all the wrappers need
role="presentation"
to not interfere with thelistbox
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