WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.39k stars 4.15k forks source link

Page List inside Navigation block does not respect justification selection #29767

Closed Sandstromer closed 3 years ago

Sandstromer commented 3 years ago

Description

When creating a menu with the Navigation block and the Page List block, the navigation alignment choice is not passed through to the Page List.

Step-by-step reproduction instructions

Add a Navigation block. Toggle the "Justification" icon, select a justification option e.g. 'Justify items right' In the navigation block, add the Page List block to build a menu.

Expected behaviour

The menu should respect the justification selection.

Actual behaviour

The menu built from the Page List does not respect the justification of the parent Navigation block.

Screenshots or screen recording (optional)

Code snippet (optional)

With the extra UL of the page list, the justification is only applied to the first UL of the navigation block

<nav class="items-justified-right wp-block-navigation">
  <ul class="wp-block-navigation__container">
    <ul class="wp-block-page-list">
 .items-justified-right > ul {
    justify-content: flex-end;
}

WordPress information

Device information

jasmussen commented 3 years ago

Thanks for the report! I took a stab at this one in #29771.

Though, justifications left, center and right work fine for me. I just need to unselect the navigation block to see the change.

Sandstromer commented 3 years ago

Sorry, I should have clarified it is on the frontend that the justifications do not work.

In the editor, it looks okay: nav-block-editor

On the frontend, all navigation blocks with page list are displayed the same, regardless of the justification: nav-block-frontend

jasmussen commented 3 years ago

Ah, that appears to be a TwentyTwentyOne bug. I am not seeing that in my own theme:

Screenshot 2021-03-11 at 14 18 00

CC: @kjellr @scruffian any thoughts?

Sandstromer commented 3 years ago

@jasmussen I have now tested with other themes and it does appear to be an issue with TT1 so I'll close this.

jasmussen commented 3 years ago

I'm keeping my PR open as I think the space-between issue is worth looking at. Thanks again for the report!