-
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
Block gallery: delete image with delete or backspace keys #14822
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the code changes are good, but I'd like an accessibility check here.
I've quickly tested with various browser / screen reader combinations and the removal works. A bit surprisingly because I wasn't expecting Regardless, it works. A pre-existing issue (triggered also when removing an image via the dedicated button) is that focus is not managed. When the selected image (currently focused element) gets removed, there's no focused element any longer so a focus loss happens. Focus should be moved to the most logical place. Not sure what the best place is 🙂 Ideally:
I do realize this would be complicated so I'd be OK with always moving focus to the block focusable container: at least it would avoid a complete focus loss. I also do realize it's not strictly related to this PR so it might be addressed separately but since we're here... 🙂 |
If I'm recalling correctly, there was a specific impact of both the specific key pressed and the effective |
Yep, evidently it works on images (implicit role=img). |
Created an issue for the focus loss at #14946 |
OK, I'm going to go ahead here and land this so it's in the list of bugfixes to port to WordPress 5.2. Shameless self-promotion in case anyone has time to review related gallery bugfixes that deal with keyboard navigation and focus management: #14930 and #14821 I'm going to be out next week, but I'll try to save a couple of hours tomorrow or perhaps Sunday in case reviews come today when I' already AFK. It'd be nice to get those bugfixes in as well! |
Fixes #14816