[wp-trac] [WordPress Trac] #39859: wp.media.view.Modal jumps when you open it

WordPress Trac noreply at wordpress.org
Tue Jul 11 22:12:06 UTC 2017


#39859: wp.media.view.Modal jumps when you open it
-----------------------------+---------------------------------------------
 Reporter:  andreiglingeanu  |       Owner:
     Type:  defect (bug)     |      Status:  new
 Priority:  normal           |   Milestone:  Future Release
Component:  Media            |     Version:
 Severity:  normal           |  Resolution:
 Keywords:  has-patch        |     Focuses:  ui, javascript, administration
-----------------------------+---------------------------------------------

Comment (by afercia):

 > It turns out, that this incorrect way to focus an element causes the
 whole page to change its scroll position.

 Setting focus on a modal dialog is required, otherwise focus will stay on
 the page behind the modal thus making the modal not usable (or hardly
 usable) with a keyboard.

 As far as I see, the real problem here is that focus is set on the modal
 wrapper: the element with id
 `id="__wp-uploader-id-{number here}"`
 this element has zero height and it's placed at the bottom of the source.
 The browser just scrolls to the focused element.

 Ideally, focus should be set on the real modal element: the first child of
 `id="__wp-uploader-id-{number here}"`
 - should have `tabindex="0"`
 - should have an `aria-labelledby` attribute pointing to the visible
 heading in the modal
 - the visible heading in the modal should have an ID for that
 - since this is a modal with content that is not exclusively interactive,
 it should ''not'' have a `role="dialog"`

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


More information about the wp-trac mailing list