Skip to content

The whole page shifts when the sidebar gets a scrollbar #45386

Closed

Description

@corentin-gautier

Description

When selecting blocks, if the right sidebar doesn't have a scrollbar then suddenly gets one, the whole page shifts to the left, triggering repaint all over the place,

This could be fixed by having an overflow-y: scroll instead of an overflow: auto on the sidebar

Here's an example of the code I have currently to fix this:

// Avoid layout shift on block selection
.interface-interface-skeleton__sidebar:has(.interface-complementary-area) {
  overflow-y: scroll;
}

The issue comes from the fact that the sidebar content width is set to 280px and the sidebar width is set to auto with an overflow auto.

Step-by-step reproduction instructions

  1. Go to https://wordpress.org/gutenberg/
  2. Select the "Say Hello ..." title block
  3. Select the "Try Gutenberg today in WordPress" button

Screenshots, screen recording, code snippet

Screen.Recording.2022-10-28.at.16.00.04.mov

Environment info

  • on a screen high enough that sometimes the sidebar content doesn't overflow

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

Related to #23427

Activity

  1. added
    [Type] Enhancement
    [Package] Interface
    on Oct 31, 2022
  2. added
    [Status] In Progress
    on Jan 16, 2023
  3. removed
    [Status] In Progress
    on May 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

[Package] Interface[Type] Enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions