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

[Dataviews] Fix: Space does not triggers the media button on grid view. #67791

Conversation

jorgefilipecosta
Copy link
Member

Fixes an issue reported by @oandregal at #67690 (comment). Currently while pressing space on the media button in the grid view the button is not triggered as expected. This PR fixes the issue.

Testing Instructions

Goto http://localhost:7888/site-wp-dev/wp-admin/site-editor.php?p=%2Fpage&layout=grid
Focus the search field tab until you focus a grid item press space and verify the button is triggered as expected.

@jorgefilipecosta jorgefilipecosta added [Type] Bug An existing feature does not function as intended [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). labels Dec 10, 2024
if ( event.key === 'Enter' || event.key === '' ) {
if (
event.key === 'Enter' ||
event.key === '' ||
Copy link
Member

Choose a reason for hiding this comment

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

What's the key related to empty space?

Copy link
Member Author

Choose a reason for hiding this comment

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

In my testing, I needed to add ' ' because space was triggering it. But supposedly '' which was already there can also be for space so I left both.

Copy link
Member

Choose a reason for hiding this comment

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

I wonder if the empty string was just mistyping for SPACE key? cc @youknowriad @gigitux who were involved in this, if my memory doesn't fail me.

Copy link

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: jorgefilipecosta <[email protected]>
Co-authored-by: oandregal <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@jorgefilipecosta jorgefilipecosta merged commit 7065f49 into trunk Dec 10, 2024
51 of 70 checks passed
@jorgefilipecosta jorgefilipecosta deleted the fix/space-does-not-triggers-the-media-button-on-grid-view branch December 10, 2024 13:27
@github-actions github-actions bot added this to the Gutenberg 19.9 milestone Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants