Block gallery: delete image with delete or backspace keys#14822
Block gallery: delete image with delete or backspace keys#14822
Conversation
|
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