-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Color Controls: Allow popovers to remain within smaller viewports #41929
Conversation
Size Change: +9 B (0%) Total Size: 1.25 MB
ℹ️ View Unchanged
|
Thanks for giving this a run @jameskoster 👍
Agreed. This is essentially what I was referring to by the following note in the PR description.
I don't think we have the means just yet to tweak the automatic positioning of Popovers. I believe there is some extra work we'll need to do to expose more of the underlying floatingUI library functionality. Given that, the aim of this PR is to get the popovers at least back into the viewport so they can be used, then improve the positioning as soon as we can. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This worked as advertised for me. I think it is worth merging this fix in ahead of the changes to allow better placement as it at least allows the color picker to be used again on smaller screens, and the placement to the left of the panel is still fine on larger screens.
Fixes: #41894
What?
Allows color control popovers from the Inspector Controls sidebar to remain within smaller viewports.
Note: This PR only restores the visibility and usability of the color control popovers. There is some ongoing work around better positioning after the floatingUI changes. Once that settles we can improve the color popover positioning as a follow-up.
Why?
After the recent switch of popovers to use the floatingUI library (#40740) the color controls were offset to outside the sidebar. This placement and offset meant the popover was outside the viewport when the sidebar becomes a full-width overlay on smaller viewports.
How?
Toggles on the
__unstableShift
Popover prop so that if the popover falls outside the viewport it is automatically repositioned.Testing Instructions
Screenshots or screencast
Screen.Recording.2022-06-24.at.5.06.20.pm.mp4
Screen.Recording.2022-06-24.at.5.00.22.pm.mp4