Make WordPress Core

Opened 3 years ago

Closed 2 years ago

#24150 closed enhancement (wontfix)

tabindex doesnot work proper if metabox added

Reported by: amolv Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.5.1
Component: Accessibility Keywords:
Focuses: Cc:


In {wp-admin} default post add form, if metabox added tab button skips metaboxes and directly goes to Publish box to take action.

Developer who wants to add tabindex to all metaboxes created, add_meta_box function should have parameter to set tabindex which will allow to go through it before publish post or skip if false.

Change History (8)

#1 @SergeyBiryukov
3 years ago

  • Keywords reporter-feedback added
  1. Could you confirm that the issue still exists after [21311] (for #21340)?
  2. In that case, could your provide a piece of code to reproduce the issue?

#2 @amolv
3 years ago

Hi SergeyBiryukov,

use add add_meta_box, { http://codex.wordpress.org/Function_Reference/add_meta_box } and add one metabox to any post type and check how tabindex works in admin.

#3 @amolv
3 years ago

  • Keywords reporter-feedback removed

#4 @amolv
3 years ago

Hey SergeyBiryukov,
Do you know what is 'add_meta_box' ?

#5 in reply to: ↑ description @lessbloat
2 years ago

Replying to amolv:

Hey amolv,

I assure you that Sergey knows what 'add_meta_box' is. ;-)

Instead of telling us in a short sentence what to do, it would be much more helpful if you could provide a code sample, or even a screenshot of how you've added the new meta box.

My guess from your description is that you've added a meta box above the publish meta box, and when you tab from the editor, it goes directly to the publish meta box and skips your new meta box. Is that correct?

#6 @amolv
2 years ago

Yes sir, you are correct, http://demo.amiworks.co.in/wptest/Add%20New%20Post.png, Please check screenshot I tried to describe more.

#7 @azaozz
2 years ago

TinyMCE has a setting to control what happens when the user tabs out of the editor iframe. For the main editor this is set to insert-media-button,save-post as the "Add Media" button is before the editor and the "Publish" postbox is next in the html.

This can be changed from PHP in tinymce_before_init, or JS in tinymce.get('content').settings.tabfocus_elements. Note that changing the "natural" flow of tabbing usually hurts accessibility. Also the default value :prev,:next doesn't work consistently on that screen.

Last edited 2 years ago by azaozz (previous) (diff)

#8 @lessbloat
2 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

@azaozz's solution looks like it will work well for this situation. The default behavior should still continue to place the focus in the .minor-publishing-actions box after leaving the editor. As such I'm closing this as "wont-fix".

Note: See TracTickets for help on using tickets.