Enable shift in URLPopover component#42214
Conversation
|
Size Change: +4 B (0%) Total Size: 1.25 MB
ℹ️ View Unchanged
|
aaronrobertshaw
left a comment
There was a problem hiding this comment.
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
shiftfunctionality 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 toshiftand 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
URLPopovernear the edges of a viewport.Social Iconsblock, or theImageblock to insert link.Before
before.mov
After
after.mov