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

Query Loop - Add accessibility markup at the end of the loop in all cases. #55890

Merged
merged 3 commits into from
Nov 7, 2023

Conversation

cbravobernal
Copy link
Contributor

@cbravobernal cbravobernal commented Nov 6, 2023

What?

As the enhanced query loop is adding accessibility tags at the end of the markup. It was searching for a div tag.
The query loop can have also aside, section, a different tag than just a div. So, with this PR, the markup is added at the end of the query loop always.

Testing Instructions

  1. Add a query loop with pagination, more than 3 posts, 3 posts per page in configuration. Disable force reload.
  2. Set the query loop HTML element as a non default tag (section, aside, etc).
    3)At the frontend, check that
<div
	class="wp-block-query__enhanced-pagination-animation"
	data-wp-class--start-animation="selectors.core.query.startAnimation"
	data-wp-class--finish-animation="selectors.core.query.finishAnimation"
></div>

is at the end of the query loop markup.

Testing Instructions for Keyboard

Screenshots or screencast

Before:
Screenshot 2023-11-06 at 14 02 58

After:
Screenshot 2023-11-06 at 14 02 40

@cbravobernal cbravobernal added [Type] Enhancement A suggestion for improvement. [Block] Query Loop Affects the Query Loop Block Backport to WP Minor Release Pull request that needs to be backported to a WordPress minor release labels Nov 6, 2023
@cbravobernal cbravobernal self-assigned this Nov 6, 2023
Copy link

github-actions bot commented Nov 6, 2023

Flaky tests detected in ab2d4f5.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6776643938
📝 Reported issues:

Copy link
Member

@luisherranz luisherranz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks Carlos. I just have one question below 🙂

packages/block-library/src/query/index.php Show resolved Hide resolved
@cbravobernal cbravobernal changed the title Query Loop - Add accesibility markup at the end of the loop markup with different Query Loop - Add accesibility markup at the end of the loop in all cases. Nov 6, 2023
Copy link

github-actions bot commented Nov 6, 2023

This pull request has changed or added PHP files. Please confirm whether these changes need to be synced to WordPress Core, and therefore featured in the next release of WordPress.

If so, it is recommended to create a new Trac ticket and submit a pull request to the WordPress Core Github repository soon after this pull request is merged.

If you're unsure, you can always ask for help in the #core-editor channel in WordPress Slack.

Thank you! ❤️

View changed files
❔ phpunit/blocks/render-query-test.php

@cbravobernal cbravobernal marked this pull request as ready for review November 6, 2023 21:17
@cbravobernal cbravobernal requested review from DAreRodz and removed request for ajitbohra November 6, 2023 23:25
@cbravobernal cbravobernal merged commit 478ea73 into trunk Nov 7, 2023
52 checks passed
@cbravobernal cbravobernal deleted the fix/replace-closing-div-with-custom-tag branch November 7, 2023 09:18
@github-actions github-actions bot added this to the Gutenberg 17.1 milestone Nov 7, 2023
mikachan pushed a commit that referenced this pull request Nov 9, 2023
…ses. (#55890)

* Use tagName if exists

* Added a test using string positions, we could refactor

* Refactor to use Tag Processor
@mikachan
Copy link
Member

mikachan commented Nov 9, 2023

I just cherry-picked this PR to the 6.4-next-point-release branch to get it included in the next release: be23264

@mikachan mikachan removed the Backport to WP Minor Release Pull request that needs to be backported to a WordPress minor release label Nov 9, 2023
mikachan pushed a commit that referenced this pull request Nov 13, 2023
…ses. (#55890)

* Use tagName if exists

* Added a test using string positions, we could refactor

* Refactor to use Tag Processor
@bph bph changed the title Query Loop - Add accesibility markup at the end of the loop in all cases. Query Loop - Add accessibility markup at the end of the loop in all cases. Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Query Loop Affects the Query Loop Block [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants