-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Enable shift
in URLPopover component
#42214
Conversation
Size Change: +4 B (0%) Total Size: 1.25 MB
ℹ️ View Unchanged
|
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.
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.
Thanks for the fix @ntsekouras 👍
I could replicate the original issue and applying this PR's changes fixes the problem for me. Tested with the image, gallery, and social icons blocks.
Like you and Andrew, I'm not sure under what circumstances we'd not want to ensure the popover remains within the viewport. Until we have an answer to that, this seems like a nice quick win.
My only question is, should we also be tweaking the URLInput
component as well?
The URLInput when adding a link to paragraph text can still be positioned outside the viewport as seen below. This can be done in a separate PR of course.
Thanks for the reviews!
We should see this in a separate PR because I saw some differences when inside an iframe(site editor), so needs more looking into the Popover internals. |
I'm late to the party, but thanks for fixing this one up @ntsekouras!
Happy to help review if you wind up pushing a PR to look at this 🙂 |
What?
This PR adds makes URLPopover component to use the
shift
functionality which checks if the popover is within the viewport. I'm currently exploring some issues with the Popover and I'm still wondering where we should not want toshift
and made that change here.We might remove this flag in the future or change the default, or pass some more specific options to fine tune the shifting of some components..
Testing Instructions
URLPopover
near the edges of a viewport.Social Icons
block, or theImage
block to insert link.Before
before.mov
After
after.mov