Make WordPress Core

Opened 6 years ago

Last modified 6 months ago

#45021 accepted defect (bug)

Media: Gallery modal has wrong focus and image detail

Reported by: joyously's profile joyously Owned by: joedolson's profile joedolson
Milestone: Future Release Priority: normal
Severity: normal Version: 6.1.1
Component: Media Keywords: has-screenshots needs-patch
Focuses: javascript Cc:

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 6 years 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 6 years 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 6 years 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 (36)

@joyously
6 years ago

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

@joyously
6 years ago

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

@joyously
6 years 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
5 years 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.

This ticket was mentioned in Slack in #core by joyously. View the logs.


4 years ago

#3 @SergeyBiryukov
4 years ago

  • Focuses accessibility added

#4 @joedolson
3 years ago

  • Milestone changed from Future Release to 6.0
  • Owner set to joedolson
  • Status changed from new to accepted

This ticket was mentioned in Slack in #accessibility by ryokuhi. View the logs.


2 years ago

#6 @joedolson
2 years ago

I took a close look at this, and in my testing I think there's some lack of clarity, but it isn't focus issues. A lot of the focus states were changed when the media library was adapted to use a standardized tab UI in https://core.trac.wordpress.org/ticket/47149, so much of this is possibly obsolete.

1) Add Media > Focus is set to the Add Media dialog.

There's no visible focus, because it's the entire dialog that has focus. This is fine.

2) Create Gallery > Search focused.

I wasn't able to reproduce this; in my testing, after clicking 'Create Gallery', the next tab moved focus to the Media Library tab, then within the tab.

3) Click an image, then Create Gallery > Selected image is focused.

The selected image is not focused, though the 'image selected' state is very similar to the 'image focused' state. There isn't a screenshot showing this state, so this may have changed since the original report; but perhaps the 'selected image' design should be better differentiated from the 'focused' design? They aren't the same; focused has a shadow/blur outline, selected is a solid outline, but they are similar.

4) If multiple images selected in Edit Gallery / Create Gallery, then 'Create a New Gallery' clicked, 'Cancel Gallery' is focused.

At this point, I'm getting 'Edit Gallery' as the focus, which represents the current view; I think that's reasonable.

Most of the differences above stem from the changes following the Media Library changes stemming from https://core.trac.wordpress.org/ticket/47149.

5) On cancelling the creation of a gallery, the selected images are still selected in Add Media.

This seems like a legitimate problem, still - though it's not focus related. We do have two separate controls: one to clear the selection, and one to cancel creation of the gallery. They are technically different actions, but I think it's very reasonable that a user would expect cancelling the creation of a gallery to also clear their selection. I think we should consider that change. I'm not sure what the use case might be for "cancel creating this gallery, but retain the selected images".

#7 @joedolson
2 years ago

It may be that this ticket should be closed and a new ticket created to decide whether cancelling a gallery should update the selection, since the majority of the issues in this ticket are already resolved elsewhere.

#8 @joyously
2 years ago

A new ticket loses the history from this one.
I say just fix whatever problems still remain, on this ticket.

This ticket was mentioned in Slack in #accessibility by ryokuhi. View the logs.


2 years ago

#10 @ryokuhi
2 years ago

  • Focuses accessibility removed

This ticket was reviewed today during the Accessibility Team's weekly bug-scrub.
As all accessibility issues have been solved elsewhere and the only remaining discussion is about whether cancel should clear the selected gallery collection or not (which is not an accessibility issue), the Accessibility Team agreed to remove the accessibility focus and leave all decisions to the Media Team.

This ticket was mentioned in Slack in #core-media by antpb. View the logs.


2 years ago

#12 @antpb
2 years ago

  • Milestone changed from 6.0 to 6.1

Being close to the 6.0 milestone it may be a stretch to get this resolved and tested before the release. Moving this to 6.1 to allow more time.

#13 @joyously
2 years ago

I took a close look at this, and in my testing I think there's some lack of clarity, but it isn't focus issues. A lot of the focus states were changed when the media library was adapted to use a standardized tab UI

Since this was written 4 years ago, it was in the context of the classic editor. I retested with both classic and block editors, and the focus issues are gone, but the image issues remain:

  • inability to unselect images on Edit Gallery
  • showing previously selected image details on second entry to Edit Gallery
  • added images not selected when Cancel is chosen
  • previous selections remain on second entry to Add Media from classic editor

This ticket was mentioned in Slack in #core-media by antpb. View the logs.


23 months ago

This ticket was mentioned in Slack in #core-media by antpb. View the logs.


23 months ago

#16 @antpb
23 months ago

  • Milestone changed from 6.1 to 6.2

This ticket still needs attention to bring it across the line. Beta 1 is in an hour so it seems unlikely this will be finished with enough time to feel comfortable.

Moving to 6.2 please feel free to move back in if needed.

This ticket was mentioned in Slack in #core-media by joyously. View the logs.


20 months ago

#18 @ira2910
19 months ago

  • Version set to 6.1.1

The problem still persists in 6.1.1. Here are my steps and the accompanying screenshots:

1.First, I selected a few photos to add to a gallery.

https://i.paste.pics/L1Y0U.png

2.Then I cancelled and selected other photos.

https://i.paste.pics/L1Y1D.png

3.Still the details of the selected image from before was being displayed.

https://i.paste.pics/L1Y1Q.png

This ticket was mentioned in Slack in #core by costdev. View the logs.


18 months ago

#20 @costdev
18 months ago

  • Keywords dev-feedback added

@joyously @joedolson @antpb Do you have time to look into this more during 6.2, or should it be moved to Future Release?

This ticket was mentioned in Slack in #core-media by antpb. View the logs.


17 months ago

#22 @antpb
17 months ago

  • Milestone changed from 6.2 to 6.3

This is going to need to be moved to 6.3 to allow more time to investigate and solve.

This ticket was mentioned in Slack in #core by chaion07. View the logs.


13 months ago

#24 @costdev
13 months ago

  • Keywords dev-feedback removed

This ticket was reviewed during the recent bug scrub. As dev feedback was received, we're removing the dev-feedback keyword.

Props to @chaion07 and @poena for discussion.

This ticket was mentioned in Slack in #core-media by antpb. View the logs.


13 months ago

This ticket was mentioned in Slack in #core by mukeshpanchal27. View the logs.


13 months ago

#27 @mukesh27
13 months ago

  • Milestone changed from 6.3 to 6.4

This ticket was discussed during bug scrub and due to lack of patch it was
decided to move it out of the current 6.3 milestone. I'm moving this to 6.4.

Additional props to @oglekler

This ticket was mentioned in Slack in #core-media by antpb. View the logs.


11 months ago

#29 @nicolefurlan
10 months ago

@joedolson I'm checking in on the tickets in the 6.4 milestone since we're ~2 weeks out from RC1. Do you think we'll be able to include a fix for this ticket in the release?

This ticket was mentioned in Slack in #core-media by antpb. View the logs.


10 months ago

#31 @joedolson
10 months ago

  • Milestone changed from 6.4 to 6.5

Punting to 6.5; out of time to work on this in this cycle.

This ticket was mentioned in Slack in #core by audrasjb. View the logs.


6 months ago

#33 @audrasjb
6 months ago

  • Milestone changed from 6.5 to Future Release

As per today's bug scrub, we decided to move this ticket to Future Release to give it more time to get a patch.

Note: See TracTickets for help on using tickets.