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

Post pagination: duplicate inner wrapper #35610

Closed
chthonic-ds opened this issue Oct 13, 2021 · 6 comments
Closed

Post pagination: duplicate inner wrapper #35610

chthonic-ds opened this issue Oct 13, 2021 · 6 comments
Labels
[Block] Query Pagination Affects the Query Pagination Block - used for pagination within the Query Loop Block

Comments

@chthonic-ds
Copy link
Contributor

Description

The post pagination markup looked like this prior to the 11.7 release:

<div class="wp-container-61676156d9e74 wp-block-query-pagination">
  <div class="post-navigation-link-previous wp-block-post-navigation-link"></div>
  <div class="post-navigation-link-next wp-block-post-navigation-link"></div>
</div>

Since 11.7, there's a duplicate .wp-block-query-pagination attached to an inner wrapper <div>:

<div class="wp-container-61676156d9e74 wp-block-query-pagination">
  <div class="wp-block-query-pagination">
    <div class="post-navigation-link-previous wp-block-post-navigation-link"></div>
    <div class="post-navigation-link-next wp-block-post-navigation-link"></div>
  </div>
</div>

This means the flex styles managed by the .wp-container-* class are no longer applied to the intended target, .wp-block-post-navigation-link.

Step-by-step reproduction instructions

  1. Activate a theme with post pagination blocks (e.g. Tove).
  2. Create a few posts to generate post pagination links.
  3. With 11.6 active: visit a post and view the post pagination markup.
  4. Repeat 3. with 11.7 active.

Screenshots, screen recording, code snippet

11.6 active
image

11.7 active
image

Environment info

  • WordPress 5.8
  • Gutenberg 11.7
  • Any theme with post pagination blocks active

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

@chthonic-ds
Copy link
Contributor Author

chthonic-ds commented Oct 13, 2021

Looking at a single.html template:

Prior to 11.7, it seems <div class="wp-block-query-pagination"> was required to wrap the previous/next pagination blocks? Like so:

<!-- wp:query-pagination {"layout":{"type":"flex","justifyContent":"space-between"}} -->
<div class="wp-block-query-pagination">
  <!-- wp:post-navigation-link {"type":"previous","label":"Previous","showTitle":true} /-->
  <!-- wp:post-navigation-link {"type":"next","label":"Next","showTitle":true} /-->
</div>
<!-- /wp:query-pagination -->

Since 11.7, it appears this is automatically handled by <-- wp:query-pagination -->. When the wrapper <div> is removed from the template, the flex layout works correctly.

I guess this is not a bug and instead requires a theme update?

@chthonic-ds
Copy link
Contributor Author

The two circumstances I'm seeing this happen with 11.7 active:

The duplicate wrapper no longer appears once a template is saved via the Site Editor in 11.7.

@carolinan
Copy link
Contributor

Yes I noticed this too and needed to update the markup in the themes .html file.
I assume this change will be announced in the post for the plugin release.

@carolinan carolinan added the [Block] Query Pagination Affects the Query Pagination Block - used for pagination within the Query Loop Block label Oct 14, 2021
@Mamaduka
Copy link
Member

Sorry, this is my fault. The change was introduced via #35092 to fix the empty container issue.

@Mamaduka
Copy link
Member

The note has been added to the release post.

@chthonic-ds
Copy link
Contributor Author

Thank you, @Mamaduka!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Query Pagination Affects the Query Pagination Block - used for pagination within the Query Loop Block
Projects
None yet
Development

No branches or pull requests

3 participants