WordPress.org

Make WordPress Core

Opened 13 months ago

Last modified 6 months ago

#45021 new defect (bug)

Media: Gallery modal has wrong focus and image detail

Reported by: joyously Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: Media Keywords: has-screenshots needs-patch
Focuses: javascript Cc:
PR Number:

Description

When you first click on Add Media from the post editor, the existing images are shown, and nothing has specific "focus" (blue outline).

Clicking on Create Gallery first, the Search box is focused.
Clicking on images first, and then Create Gallery, the last image selected is focused.

Once images are selected, clicking on the Create New Gallery button, the Cancel Gallery link is focused.

On the Edit Gallery page, before clicking on an image, the sidebar shows Gallery Settings for link, columns, size. Once an image is selected, there is no way to unselect it, and although the Gallery settings remain the same, it is unclear whether this applies to the image selected or the entire gallery. Regardless, the image details are shown in the sidebar. However, if you Cancel Gallery and choose different images, when you get back to the Edit Gallery page, it will still be showing the image details for the old image, not any of the newly chosen ones (but none of the images are focused when you get there). So the Cancel didn't actually cancel.

If you close the modal without inserting the gallery into the post, and then click on Add Media again, it will show the values from the last attempt. This is unexpected, and unwanted if you had selected a lot of images and wanted to start over. There is a Clear link, but it is small and at the bottom. The last selected image is focused, but not after you click Create Gallery (the Cancel Gallery link is), so the image detail is the wrong one. If you go ahead and insert the gallery, and click Add Media again, then nothing is remembered from the previous gallery.

While in Edit Gallery, if you had selected two images and click on Add to Gallery, you can select more and click Add, they will all be shown, with one image focused and showing the correct image detail. Clicking Cancel Gallery at this point returns to the media list, but with the original two selected and perhaps a different image focused than the previous list. The added ones are forgotten.

Attachments (3)

add-media-nothing-focused.jpg (103.4 KB) - added by joyously 13 months ago.
click on Add Media from the post editor, the existing images are shown, and nothing has specific "focus"
create-gallery-Cancel-focused.jpg (57.8 KB) - added by joyously 13 months ago.
clicking on the Create New Gallery button, the Cancel Gallery link is focused
edit-gallery-different-images-wrong-detail.jpg (72.3 KB) - added by joyously 13 months ago.
Cancel Gallery and choose different images, when you get back to the Edit Gallery page, it will still be showing the image details for the old image

Download all attachments as: .zip

Change History (4)

@joyously
13 months ago

click on Add Media from the post editor, the existing images are shown, and nothing has specific "focus"

@joyously
13 months ago

clicking on the Create New Gallery button, the Cancel Gallery link is focused

@joyously
13 months ago

Cancel Gallery and choose different images, when you get back to the Edit Gallery page, it will still be showing the image details for the old image

#1 @joemcgill
6 months ago

  • Focuses javascript added
  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to Future Release

Thanks for the report @joyously. I can confirm that this is still an issue in the block editor with both the Gallery block and when adding a gallery in the classic editor.

Note: See TracTickets for help on using tickets.