-
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
Update the block popover position as we scroll the container #41402
Conversation
Size Change: +21 B (0%) Total Size: 1.24 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.
This seems to have fixed the issue 🎉
Before:
toolbar.position.mp4
After:
toolbar.mp4
@@ -115,6 +115,7 @@ const Popover = ( | |||
__unstableSlotName = SLOT_NAME, | |||
__unstableObserveElement, | |||
__unstableForcePosition, | |||
__unstableShift = false, |
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.
It looks like switching this to default to false
caused a small regression for the Tooltip component which relies on the shift behaviour to prevent the Tooltip from causing the editor to overflow. I've opened up a separate PR to opt-in to the __unstableShift
for the Tooltip in #41524
Extracted from #41156
What?
In the site editor, if you select a block and scroll the page, you'll notice that the block toolbar doesn't stick by the block element. This PR fixes that.
How?
The behavior here (update on scroll) was present in the original Popover implementation, this just brings it back.
Notes
Testing Instructions
1- Navigate to the site editor
2- Select a block
3- scroll the canvas
4- the block popover should stay by the block.