[wp-trac] [WordPress Trac] #29838: Post editing area: keyboard accessibility, tab order and focus

WordPress Trac noreply at wordpress.org
Sat Oct 5 14:53:56 UTC 2024


#29838: Post editing area: keyboard accessibility, tab order and focus
--------------------------+--------------------------------
 Reporter:  afercia       |       Owner:  rcreators
     Type:  defect (bug)  |      Status:  assigned
 Priority:  normal        |   Milestone:  6.7
Component:  Editor        |     Version:  4.0
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:  ui, accessibility
--------------------------+--------------------------------

Comment (by joedolson):

 Updated patch removes the code that attempted to isolate keypresses from
 click events in the editor toggle.

 Changes now include:

 - Removes code that shifted focus from title input to post content,
 bypassing the media and editor controls.
 - Sets `aria-pressed` states on editor buttons to communicate current
 selection.
 - Makes focus state visible on unselected editor button
 - Removes `wp_keep_scroll_position` conditional check since IE is no
 longer supported.
 - Adds `role="presentation"` to the table in the status info bar

 I removed a chunk of code that was added by @afercia in the original
 explorations. It looked like it was intended to enable passing focus into
 internal toolbars using `shift+tab`, but didn't work. I was able to fix
 listener and find the toolbar, but the focus handling inside those
 toolbars is absent, so that became a larger task. It's an accessibility
 improvement, but probably should be handled in a separate ticket, if at
 all.

 Amended code, from line 1077 of `/tinymce/plugins/wordpress/plugin.js`:

 {{{
 editor.on( 'keydown', function( event ) {
         if ( event.keyCode === 9 && event.shiftKey ) {
                 var toolbar = $( 'body > .mce-toolbar-grp' )[0];
                 if ( toolbar ) {
                         toolbar.focus();
                 }
         }
 });
 }}}

 As the only changes I've made since @Benjamin_Zekavica's tests are to
 remove the parts that weren't working, I'm considering this already
 tested.

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


More information about the wp-trac mailing list