-
Notifications
You must be signed in to change notification settings - Fork 564
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
SelectPanel
not scrolling with anchoring element
#2184
Comments
I've looked into this a bit before because we see the same thing with Screen.Recording.2022-07-25.at.12.35.37.PM.movThe cause is that all of our overlays render into a Here's an example: On the docs page, the panels do scroll with the page because the entire document scrolling: Screen.Recording.2022-07-25.at.12.17.39.PM.movIf we put the anchor inside a scrolling container though, the menu does not scroll with its container, though it will still scroll with the document: Screen.Recording.2022-07-25.at.12.19.09.PM.movI think the only way to fix this would be to attach a |
Hi! This issue has been marked as stale because it has been open with no activity for 180 days. You can comment on the issue or remove the stale label to keep it open. If you do nothing, this issue will be closed in 7 days. |
Adding it back to Unprioritized backlog |
can we hide scrollbar while the dropdown panel gets opened? |
Hi! This issue has been marked as stale because it has been open with no activity for 180 days. You can comment on the issue or remove the stale label to keep it open. If you do nothing, this issue will be closed in 7 days. |
Also related: https://github.com/github/feature-delivery-team/issues/837 |
👋 We are experiencing the same problem for our "Include repositories by property" dialog for rulesets: https://github.com/github/repos/issues/11324#issuecomment-2091524716 |
Update: If we imitate the anchor positioning spec, it's expected that the popover moves with the anchor Demo 1: https://anchor-polyfill.netlify.app/#anchor-positioning-popover (click Apply polyfill in the header first) |
@siddharthkp does #2184 (comment) mean that the current behavior is expected? If so, what can we do to alleviate the issue when the behavior appears broken (e.g., menu doesn't scroll with anchoring element)? @camertron shared that the PVC implementation of this component makes the page inert, which means the page should not scroll when the menu is open. |
Oh, not at all. I meant if, in the future, we adopt the anchored position spec or the polyfill before it's in all browsers, that is how it would work. We do not have that today.
That is definitely an option. If it's good with the a11y team, it's good with me! |
@maximedegreve, can I get your thoughts on this as well:
|
When the dialog is anchored it should always remain anchored to its trigger. In this case there should also be no backdrop and the page should remain scrollable. I think having to click first the background to close is acceptable but scrolling should always be enabled nevertheless especially since in some instances the SelectPanel might be displayed slightly below the viewports. Whatever we do we should ensure both the PVC and React version behave exactly the same to not cause frustration to our users. Example: CleanShot.2024-09-02.at.11.43.53.mp4The above is not valid anymore if the SelectPanel is displayed as a modal variant. In this case there is a backdrop and page scrolling is locked. |
@camertron I wanted to loop you in here as well since there is feedback for the PVC implementation of |
I think we're still struggling to reach consensus on this. Here's feedback from @dipree:
See: https://github.slack.com/archives/GACAW0NPM/p1724278674795749 |
Describe the bug
SelectPanel
not scrolling with anchoring element when parent containers have different overflow properties. This also happens withActionMenu
.To Reproduce
In memex list view:
SelectPanel
SelectPanel
does not scroll with the anchoring element that is the table cellIn bulk add side panel:
+
icon in the omnibar at the bottom of the pageSelectPanel
SelectPanel
does not scroll with the repository selector buttonIn Project settings (implements
ActionMenu
):ActionMenu
does not scroll with the buttonExpected behavior
SelectPanel
andActionMenu
should scroll correctly with their anchoring elements.Screenshots
Desktop (please complete the following information):
Additional context
After doing some deductions with @siddharthkp, we suspect that the scrolling problem is caused by wrapping
SelectPanel
orActionMenu
in nested containers with different overflow properties, which causes thegetClippingRect
function to find the wrong parent node (code).The text was updated successfully, but these errors were encountered: