gutenberg
gutenberg copied to clipboard
Query block: not adding current / active class to list of posts
Description
It looks like the query block is not adding a current / active class.
Step-by-step reproduction instructions
Adjust the single template in the default theme to include the following query:
<!-- wp:query {"query":{"perPage":100,"pages":0,"offset":0,"postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":false},"layout":{"type":"default"}} -->
<div class="wp-block-query">
<!-- wp:post-template -->
<!-- wp:post-date {"style":{"typography":{"fontStyle":"normal","fontWeight":"500"},"spacing":{"margin":{"top":"0","right":"0","bottom":"0","left":"0"}}},"textColor":"contrast-light","fontSize":"small"} /-->
<!-- wp:post-title {"isLink":true,"style":{"spacing":{"margin":{"top":"var:preset|spacing|20","bottom":"var:preset|spacing|30"}}},"fontSize":"medium"} /-->
<!-- /wp:post-template -->
<!-- wp:query-no-results -->
<!-- wp:paragraph {"placeholder":"Add text or blocks that will display when a query returns no results."} -->
<p>No results.</p>
<!-- /wp:paragraph -->
<!-- /wp:query-no-results -->
</div>
<!-- /wp:query -->
View an individual article.
Open the dev console and notice the post list does not show a current or active class for the current post you're on.
Screenshots, screen recording, code snippet
Environment info
- wp 6.1.1
- gutenberg 15.1.1
- chrome
- mac
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
What would be the purpose of such a class?
@carolinan To be able to style the active class differently than the other posts listed / differentiate from active post to others.