-
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
Block Popover: Fix incorrect positioning of padding and margin visualizers on scroll #44998
Conversation
…izers on scroll. Adds a shift prop to tell whether the floating UI should shift into view or stay absolutely positioned.
…nd margin visualizers.
Size Change: +120 B (0%) Total Size: 1.27 MB
ℹ️ View Unchanged
|
This tested well for me. The new prop should probably be added to the component readme. |
Good idea! I can do that later today, or sometime tomorrow. |
Should be good to go now, just need a review to approve. |
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.
Tested well for me. The issue with the padding/margin visualiser was fixed:
Before:
shift-before.mp4
After:
shift-after.mp4
and other instances of the popover like color selector and in-between inserter still behaved as expected.
Fixes #44977.
What?
Adds a shift prop to tell whether the floating UI should shift into view or stay positioned normally.
Why?
This fixes a visual bug where if you scroll past the top of a group and use padding or margin, the visualizer appears always at the top of the page. This is due to the Floating UI library's shift property.
How?
Adds a shift prop to BlockPopover that defaults to true, as that was always the value for the component. Padding and Margin Visualizers pass false to the shift property so that Floating UI library does not put the padding and margin visualizers at the top of the screen even when scrolling past element.
Testing Instructions
Screenshots or screencast