Skip to content
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

Wrap overflow: auto in media query for smaller screens only #66176

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

colorful-tones
Copy link
Member

@colorful-tones colorful-tones commented Oct 16, 2024

What?

Addresses #66161 and #66156

Why?

The appearance of double vertical scrollbars was occurring in certain instances of the interface where the viewport height was small. It seemed to be triggered by the overflow: auto, which had a previous code comment indicating that the overflow: auto was implemented to circumvent issues with mobile Safari. Based on the commentary it seems we would want the overflow: auto to only impact smaller horizontal screens and not smaller vertical screens.

How?

By wrapping the overflow: auto in a media query: @media (max-width: #{ ($break-medium - 1) }) we make sure the overflow is only applied to smaller horizontal screens.

Testing Instructions

The original bug reported in #66161 impacts small vertical screens.

  1. Open the block editor on a desktop device with a small vertical height.
  2. Open the block inserter sidebar and note the right-most vertical scrollbar(s)
  3. Begin typing to find a block and note the right-most vertical scrollbar(s)

Screenshots or screencast

Before After
double-scrollbar-before.mp4
double-scrollbar-after.mp4

@colorful-tones colorful-tones marked this pull request as ready for review October 16, 2024 16:25
Copy link

github-actions bot commented Oct 16, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: colorful-tones <colorful-tones@git.wordpress.org>
Co-authored-by: dhruvang21 <dhruvang21@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@colorful-tones
Copy link
Member Author

Probably could use some more cross-device and browser size testing.

@colorful-tones
Copy link
Member Author

This also addresses #66156

@dhruvang21
Copy link
Contributor

Hello @colorful-tones,

I have tested this PR using the Gutenberg PR reviewer, as well as in my local Chrome and Firefox browsers across various screen sizes, and found that it resolves the issue perfectly. I’m also attaching a video of the testing for your reference.

Thanks!

66176-chrome.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Interface /packages/interface [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants