[Dialog][Popover] Scrolling issue when Popover inside Dialog
See original GitHub issueDocumentation
Relevant Radix Component(s)
Here in the docs it say to make Overlay
a sibling to Content
.
This setup doesn’t work if you have a scrollable popover in the dialog content. On this line a ref is passed to RemoveScroll
but I think that by using just a ref that RemoveScroll
doesn’t consider the portalled element a part of the react tree.
In my own code I fixed this by putting my Content
inside of my Overlay
. After this change my scrollable popover could scroll again since RemoveScroll
now has access to the react tree.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:10 (1 by maintainers)
Top Results From Across the Web
Material UI - Unblock scrolling when popover is opened
When i open the popover, the scroll-bar of the web page suddenly disappeared and it's not the part of user experience in my...
Read more >JavaScript
For performance reasons, the Tooltip and Popover data-apis are opt-in, meaning you must initialize them yourself. One way to initialize all tooltips on...
Read more >Popover
Popover is a non-modal dialog that floats around a trigger. ... Popover is built on top of the Popper.js library. Import#. Popover :...
Read more >Josh W. Comeau
... of low-level primitives, things like <ScrollArea> or <Dialog> or <Popover>. ... fixes some of the cross-browser inconsistencies with scroll containers.
Read more >Dialogs, modality and popovers seem similar. How are they ...
Note: at the time of writing, popover is still a proposal and only available as an experiment, behind a flag, and in Chromium....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hmm, yep looks like it could be a
RemoveScroll
shards thing 🙈 we need a ticket to create our own react-tree-aware remove scroll at some stage.Here you can see if you follow all of the docs for both popover and dialog you can’t scroll a popover in a dialog. I had to read through radix’s source code and dependencies to figure out that I needed to wrap my content in the overlay. While both are valid I think the docs should steer people towards code+structure that will work out of the box without having to understand how the internals are actually working.
https://codesandbox.io/s/twilight-http-veu4gw?file=/App.js