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

Extra scrollbar appears while editing patterns/template parts whenever there are notices #62911

Closed
talldan opened this issue Jun 27, 2024 · 7 comments · Fixed by #62940
Closed
Labels
General Interface Parts of the UI which don't fall neatly under other labels. Needs Design Feedback Needs general design feedback. [Type] Bug An existing feature does not function as intended

Comments

@talldan
Copy link
Contributor

talldan commented Jun 27, 2024

Description

When editing patterns any notices result in a second scrollbar appearing.

The bug happens because the notices push the editor canvas area off-screen, which triggers a scrollbar.

I'm personally unsure of the right fix. For the normal post editing experience, the editor canvas shrinks when there's a notice, so perhaps the focus mode should do the same?

Step-by-step reproduction instructions

  1. Edit a pattern (post or site editor)
  2. Add enough content so that a scrollbar appears
  3. Run this JavaScript snippet in your browser console:
wp.data.dispatch( 'core/notices' ).createInfoNotice( 'Notice' );

Observe two scrollbars

Screenshots, screen recording, code snippet

Screenshot 2024-06-27 at 4 21 31 pm

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

@talldan talldan added [Type] Bug An existing feature does not function as intended General Interface Parts of the UI which don't fall neatly under other labels. Needs Design Feedback Needs general design feedback. labels Jun 27, 2024
@t-hamano
Copy link
Contributor

I was not able to reproduce this issue, maybe it was fixed in a recent commit? Or do I need some special content?

c23ac1eceebc14d462ee42ab497ef135.mp4
@talldan
Copy link
Contributor Author

talldan commented Jun 28, 2024

@t-hamano Interesting, seems like your canvas area didn't get pushed down far enough. Does it still look ok if you add multiple notices?

@stokesman
Copy link
Contributor

Testing at 55f3a98, I was able to reproduce but only in the Post editor.

@talldan
Copy link
Contributor Author

talldan commented Jun 28, 2024

I see! I'm sure that was broken before. The site editor behaves closer to how I would expect it to work in the post editor, so hopefully there's a clue there for fixing it.

@stokesman
Copy link
Contributor

One difference between the editors I've noted are these styles applied to the VisualEditor only in the Post Editor:

.editor-visual-editor {
flex: 1 0 auto;
height: auto;
}

I found them to be creating a related issue with too many scrollbars for device previews and made #62940 for that. I just tried reproducing this issue on that branch and could not. I'd appreciate any testing or reviews on that 🙇

@t-hamano
Copy link
Contributor

Ah, I was able to reproduce that issue in the post editor too.

4a528a7de6b7c39b54815d409138e020.mp4

What we would expect here is for the editor canvas to be lowered by the height of the notification, without causing double scrollbars, like in the site editor, right?

image

@talldan
Copy link
Contributor Author

talldan commented Jun 28, 2024

@stokesman Thanks - I've approved that PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
General Interface Parts of the UI which don't fall neatly under other labels. Needs Design Feedback Needs general design feedback. [Type] Bug An existing feature does not function as intended
3 participants