[wp-trac] [WordPress Trac] #43169: Media views: avoid to move focus programmatically when not strictly necessary

WordPress Trac noreply at wordpress.org
Wed Jun 12 19:58:40 UTC 2019


#43169: Media views: avoid to move focus programmatically when not strictly
necessary
-------------------------------------+-------------------------------------
 Reporter:  afercia                  |       Owner:  afercia
     Type:  defect (bug)             |      Status:  reviewing
 Priority:  normal                   |   Milestone:  5.3
Component:  Media                    |     Version:
 Severity:  normal                   |  Resolution:
 Keywords:  has-screenshots has-     |     Focuses:  ui, accessibility,
  patch commit                       |  javascript
-------------------------------------+-------------------------------------
Changes (by afercia):

 * keywords:  has-screenshots has-patch needs-refresh => has-screenshots
     has-patch commit


Comment:

 [attachment:"43169.2.diff"] refreshes the patch. It also improves a few
 things compared to the previous one. Looks like in a few cases focus
 management in the media modal didn't work correctly since the beginning.
 For example, focus needs to be set again on the modal when switching
 between some "frames":

 Gallery:
 - canceling a Gallery
 - jumping to Edit Gallery view
 - jumping back from Add to Gallery to Edit Gallery view

 Audio Playlist:
 - canceling an Audio Playlist
 - jumping to Edit Audio Playlist view
 - jumping back from Add to Audio Playlist to Edit Audio Playlist view

 Video Playlist:
 - canceling a Video Playlist
 - jumping to Edit Video Playlist view
 - jumping back from Add to Video Playlist to Edit Video Playlist view

 Among those, only a few were implemented correctly while others completely
 missed focus management.

 To recap, this patch:
 - keeps focus management only where necessary
 - removes focus management where a specific user workflow was assumed
 - makes the edit-attachment navigation buttons really disabled when there
 are no next or previous attachments
 - clarifies with inline comments all the usages of `focus()`

 I'd like to commit this patch soon, as having it in core at the beginning
 of this release cycle is the best way to test it extensively with a larger
 testers base.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/43169#comment:15>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list