You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem occurs following the scrollable overlay example for the dialog here - https://www.radix-ui.com/primitives/docs/components/dialog#scrollable-overlay.
The styling is applied correctly and scrolling with scroll wheel, trackpad or slide gesture works as expected. However when scrolling by clicking the scrollbar on the right, it triggers the click outside listener and closes the dialog.
Expected behavior
Clicks over the scrollbar that appears should not close the Dialog.
What comes to mind to me is just doing custom logic for detection of clicks on the scrollbar in the click outside listener.
Note: I have not looked at code at all and have no idea of the internals and whether or not that is possible.
Your environment
Software
Name(s)
Version
Radix Package(s)
@radix-ui/react-dialog
1.0.3
React
n/a
16.13.1
Browser
Google Chrome
latest
Node
n/a
18.0.0
pnpm
n/a
8.14.3
Operating System
Mac OS
Sonoma 14.5
The text was updated successfully, but these errors were encountered:
dimitur2204
changed the title
[Dialog] Scrollable overlay closes when trying to scroll with the scrollbar
[Dialog] Scrollable overlay closes Dialog when trying to scroll with the scrollbar
May 1, 2024
Bug report
Current Behavior
The problem occurs following the scrollable overlay example for the dialog here - https://www.radix-ui.com/primitives/docs/components/dialog#scrollable-overlay.
The styling is applied correctly and scrolling with scroll wheel, trackpad or slide gesture works as expected. However when scrolling by clicking the scrollbar on the right, it triggers the click outside listener and closes the dialog.
Expected behavior
Clicks over the scrollbar that appears should not close the Dialog.
Reproducible example
https://codesandbox.io/p/sandbox/elegant-ritchie-vhp3xp
You should click the "Open" and then reduce the height until the dialog overflows on the Y-axis, then try scrolling by clicking the scrollbar.
Suggested solution
What comes to mind to me is just doing custom logic for detection of clicks on the scrollbar in the click outside listener.
Note: I have not looked at code at all and have no idea of the internals and whether or not that is possible.
Your environment
The text was updated successfully, but these errors were encountered: