[wp-trac] [WordPress Trac] #28857: Media Grid: Manage focus when toggling between the grid and an edit attachment modal
WordPress Trac
noreply at wordpress.org
Fri Jul 25 16:06:15 UTC 2014
#28857: Media Grid: Manage focus when toggling between the grid and an edit
attachment modal
---------------------------+----------------------------------------
Reporter: davidakennedy | Owner: wonderboymusic
Type: defect (bug) | Status: reopened
Priority: normal | Milestone: 4.0
Component: Media | Version: trunk
Severity: normal | Resolution:
Keywords: needs-patch | Focuses: accessibility, javascript
---------------------------+----------------------------------------
Comment (by adamsilverstein):
Good point. I put the focus call inside the close callback because we
already had a close callback - I can see how shifting it to a listener in
MediaFrame.Manage makes more sense structurally and would allow us to more
narrowly focus the selector.
Replying to [comment:10 ericlewis]:
> We should think about the implementation here more thoroughly.
>
> We should never use global jQuery selectors in Backbone code, this
typically implies an object is taking on more responsibility than it can
handle.
>
> The task of reestablishing focus on the correct element should probably
live within the `media.view.MediaFrame.Manage` controller. As this
controller opens up the modal via the `openEditAttachmentModal` method, it
should probably also listen to events happening on that frame to keep
track of what attachment is currently being edited/viewed in the modal,
and on close reestablish focus appropriately.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/28857#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list