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

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ export default function getClickableItemProps< Item >( {
onClickItem( item );
},
onKeyDown: ( event: React.KeyboardEvent ) => {
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.

event.key === ' '
) {
// Prevents onChangeSelection from triggering.
event.stopPropagation();
onClickItem( item );
Expand Down
Loading