-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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: add support for image reordering #14768
Conversation
cc @jasmussen |
Why limit it to the plugin only? |
Developing this only for the plugin provides a safe space for experimentation. This is why I like that space: I consider this PR the first step in adding DragNDrop support for galleries, and there are a couple of different options we can use as the drag handle for the selected image. These controls may be affected by that later decission, so I wouldn't want to introduce them to only change them in a later iteration, if needed. |
Cool, was asking because these controls already seem quite valuable to users. |
Really nice work. Perhaps you're already on this, but I'm not seeing the controls show up in the forwards tabbing order, and I'm seeing some weird tabbing behavior that may be already present in master. GIF: First issue: when I tab, I first select the image, then the caption, then the next image. But the previous image still stays in what appears to be a focused state. When I tab on to the next thumbnail, the previous thumbnail should no longer be focused. The 2nd issue is, I would expect the tabbing order to be:
Is this within workable? |
This is also an issue on
This is also an issue on I'd like to tackle this separately and receive some a11y feedback. My first thought when I saw it was: "well, this is not what I expected but perhaps is a good thing because it shortens the keyboard jumps I have to do for the common actions (move through images/edit captions/etc.)". I'm also open to fix this here if you feel like adding the moving controls totally change the expectations of what the common actions are, though. |
Okay to tackle separately for sure, but definitely something we'll want someone to tackle at some point.
Yes, but unfortunately it does so at the cost of inconsistency and unpredictability. |
I meant that I will fix this as part of my work with the gallery! Tracked at #14814 |
ed24ea2
to
bfcc397
Compare
Note that the fix for two images being selected has already landed in |
Let's try to find a way forward here, can we always show the controls but "visibly hidden" if the block is not selected, that way the tab order is always consistent? Also it seems that when you tab to the image, the container should be focused first. |
Second attempt to fix the gallery tab order can be reviewed at #15540 The idea would be to merge that and then rebase this PR on top. |
so the visual hook stays the same.
as to avoid focus loss when the control becomes disabled.
63e0bf0
to
a3e5854
Compare
The fix for the tab order has landed and this has been rebased. It's ready for another review round! |
Is it just me or the arrow buttons are not working anymore? |
This is working great for me, I'll leave the final word for the others. |
@jasmussen would you try this and 👍 if appropriate? |
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.
This PR implements the basic mechanics to move the selected image forward/backward within a gallery. Also adds the corresponding visual controls.