-
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
Site Editor: style variation preview visually jumps at certain browser height #55112
Comments
Thanks for the report, @lukecarbis! I was also able to reproduce this one. Test ReportEnvironment
Actual Results
Additional Information
Supplemental ArtifactsFigure 1: Demonstration of browser window height effect on Styles variations previews. |
What a hilariously inconvenient bug! 😅 I didn't get a chance to look into a fix today, but I think I've found the cause: In the sidebar we currently use
The trouble is, that CSS property is not available in Safari: https://caniuse.com/mdn-css_properties_scrollbar-gutter so on Safari when a scrollbar appears, the width of the content area of the sidebar will be reduced. Then, over in the preview for each of these styles, there's a
Then, that ratio is applied to the preview, affecting how tall each of those previews are. I think the endless cycle (or dancing effect) is a result of the following, though I'm not 100% sure which event occurs first:
So, for anyone looking into this issue, to reproduce, you'll need to:
I'm not too sure what the ideal fix would be here — I suspect either somewhere in If no-one beats me to it, I can look into potential fixes tomorrow! |
Thank you @andrewserong! |
Pleasure, thank you for reporting it @lukecarbis! 🎉 |
Description
When viewing the styles panel with just the right browser height (something close to 1000px for me – which incidentally is the full height on a 2023 MacBook Pro with the dock hidden), the previews jump and move around the screen constantly.
This seems to occur because the scroll bar on MacOS only shows when there's content to scroll. The Previews seem like the try to scale up to fit the available space. When they do, they cause the scroll bar to display, which reduces the available space. The previews then shrink again, causing the scroll bar to hide. This loops indefinitely.
Changing the System Setting > Appearance > Show scroll bars to "Always" prevents the problem from occurring.
Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
Screen.Recording.2023-10-06.at.8.18.39.am.mov
Environment info
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: