-
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
Fix block toolbar offset in site editor when toggling sidebars #43172
Fix block toolbar offset in site editor when toggling sidebars #43172
Conversation
8b2322b
to
fe29e43
Compare
Size Change: +20 B (0%) Total Size: 1.28 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.
LGTM, thanks Dan!
a884521
to
a3dba0d
Compare
It seems we missed this in site editor: Screen.Recording.2022-08-16.at.12.18.02.PM.movCheck on scroll what happens to the block popover.. |
I can also reproduce this. Should we revert and take another attempt at this fix? |
I think we should, yes.. |
What?
See #42770
Fixes a bug in the site editor, where the block toolbar would be offset incorrectly after inserting a block from the global inserter
Why?
In the site editor, part of the way popovers position themselves correctly is by offsetting their position against the editor canvas iframe.
When opening the inserter sidebar and inserting a block, the iframe is moved to the left to make space for the sidebar. The inserted block's toolbar iframe offset is calculated using this position that's shifted to the left.
When closing the sidebar, this offset isn't recalculated, as there's no
resize
event listener.How?
Adds a resize event listener for the iframe offset.
Testing Instructions
Expected: the block's toolbar position should be correct (aligned to the left side of the block.
Screenshots or screencast
Before
Kapture.2022-08-12.at.17.00.01.mp4
After
Kapture.2022-08-12.at.16.58.05.mp4