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

BorderBoxControl: Horizontal scrollbar is displayed in block sidebar #65207

Closed
2 tasks done
t-hamano opened this issue Sep 10, 2024 · 7 comments · Fixed by #67049
Closed
2 tasks done

BorderBoxControl: Horizontal scrollbar is displayed in block sidebar #65207

t-hamano opened this issue Sep 10, 2024 · 7 comments · Fixed by #67049
Labels
Browser Issues Issues or PRs that are related to browser specific problems OS Issues Issues or PRs that are related to OS specific problems [Package] Components /packages/components [Type] Bug An existing feature does not function as intended

Comments

@t-hamano
Copy link
Contributor

Description

Note: This can be reproduced on Windows OS/Chrome browser where the browser scrollbar has a physical width.

The sidebar width is 280px. However, due to a 17px scrollbar on Windows OS/Chrome browser, the actual content width is 263px. In this case, the box control does not fit into the grid layout and an overflow occurs.

Step-by-step reproduction instructions

Access a block that supports borders and click the "Unlink sides" button.

Screenshots, screen recording, code snippet

image

image

Environment info

No response

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
@t-hamano t-hamano added [Type] Bug An existing feature does not function as intended Browser Issues Issues or PRs that are related to browser specific problems [Package] Components /packages/components OS Issues Issues or PRs that are related to OS specific problems labels Sep 10, 2024
@mirka
Copy link
Member

mirka commented Sep 11, 2024

Good catch!

FYI, macOS also has a setting to show scrollbars with a physical width (which I have enabled), so this is not necessarily a Windows-only issue.

Scrollbar settings on macOS

@mirka mirka added the Needs Design Needs design efforts. label Sep 11, 2024
@mirka
Copy link
Member

mirka commented Sep 11, 2024

@WordPress/gutenberg-design Looks like we need some design tweaks here. The current component compresses down to 248px width, but with a scrollbar it needs to compress down to 231px (in the Windows case, 233px on Mac).

@jasmussen
Copy link
Contributor

Did we end up making a final decision on gap width? 8, 12 or 16?

Regardless, if we make a few tweaks we still get a fairly ergonomic control at 237px.

Screenshot 2024-09-12 at 09 16 05

12px gap, that could be reserved for the "exploded" view here.

Instead of the unit selector having an 8px right margin, it has a 4px right margin:

Screenshot 2024-09-12 at 09 13 23

And the width of the inputs is changed from 116px to 112px.

@jameskoster
Copy link
Contributor

It would be good to somehow eliminate any hard-coded width values so that we avoid running into this issue again in the future. Ideally the whole component should gracefully adapt to the container.

@jasmussen
Copy link
Contributor

The fixed width would be good to eliminate indeed, though I suspect it's a vestige of that partiucular exploded border view, so beyond replacing those with percentages, which we can, it's still going to be a bit tight.

By the way the numberes above assume we want to be able to show 4 digits in the field at all times. If we think 999px borders is as much as anyone needs to see, then there's more room still.

@t-hamano
Copy link
Contributor Author

Thanks everyone for the feedback.

I tried simply narrowing the width of the input field until it fits the 231px container width. In my environment, the 4th digit is slightly visible.

image

image

@mirka
Copy link
Member

mirka commented Sep 18, 2024

I tried simply narrowing the width of the input field until it fits the 231px container width. In my environment, the 4th digit is slightly visible.

I think that should be fine. I doubt people will set borders over two-digit pixels.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Browser Issues Issues or PRs that are related to browser specific problems OS Issues Issues or PRs that are related to OS specific problems [Package] Components /packages/components [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants