-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Fix: Linked featured image block cannot be selected correctly #68775
Conversation
Size Change: -43 B (0%) Total Size: 1.84 MB
ℹ️ View Unchanged
|
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Warning: Type of PR label mismatch To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task. |
With this change, the deletion works if I select the block with the mouse. But when I navigate up and down the content using the arrow keys, the featured image block has two stops, compared to on trunk, where there is one stop. If I start above the block and press arrow down key, the outline shows and the deletion works. Windows 11, Chrome Version 132.0.6834.84. |
Thanks for the review!
This seems to be happening with the Site Logo blocks, Image block as well. I recall having a discussion about this in the past. I think adding See here for more details. |
Shame, I don't like the idea of fixing an issue by making something else worse, but it is much more important that the block can be deleted. |
…ess#68775) Co-authored-by: t-hamano <[email protected]> Co-authored-by: carolinan <[email protected]>
Fixes #68774
What?
This PR will allow the linked Featured Image block to be selected correctly.
Why?
The
a
element appears unclickable at first glance becausedisabledClickProps
has been applied to it. However:onClick
event is prevented viapreventDefault
, the click event itself will still occur.aria-disabled
is an ARIA attribute, it doesn't actually disable the element.Therefore, when you select a block, the a element inside it will be selected instead of the block, so the outline will not be displayed and the delete key will not work.
How?
I used
pointer-events:none
as a simpler approach.Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast
b48b3d5793814ca554073a7a7836fb36.mp4