Customize: Fix focus and autofocus on `nav_menu_item` controls.
Embed the `nav_menu_item` control not only when the contained `nav_menu` section expands, but also if the control was autofocused (via the `autofocus[control]` query param). Also applies change from [33596] to work-around a broken `:focusable` selector in jQuery UI. See #33258. Fixes #34629. Built from https://develop.svn.wordpress.org/trunk@35584 git-svn-id: http://core.svn.wordpress.org/trunk@35548 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
1032bc6775
commit
f4659f7ee0
|
@ -1012,7 +1012,7 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
section = api.section( sectionId );
|
section = api.section( sectionId );
|
||||||
if ( section && section.expanded() ) {
|
if ( ( section && section.expanded() ) || api.settings.autofocus.control === control.id ) {
|
||||||
control.actuallyEmbed();
|
control.actuallyEmbed();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -1433,9 +1433,12 @@
|
||||||
* the first input in the control.
|
* the first input in the control.
|
||||||
*/
|
*/
|
||||||
focus: function() {
|
focus: function() {
|
||||||
this.expandControlSection();
|
var control = this, focusable;
|
||||||
this.expandForm();
|
control.expandControlSection();
|
||||||
this.container.find( '.menu-item-settings :focusable:first' ).focus();
|
control.expandForm();
|
||||||
|
// Note that we can't use :focusable due to a jQuery UI issue. See: https://github.com/jquery/jquery-ui/pull/1583
|
||||||
|
focusable = control.container.find( '.menu-item-settings' ).find( 'input, select, textarea, button, object, a[href], [tabindex]' ).filter( ':visible' );
|
||||||
|
focusable.first().focus();
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.4-beta3-35583';
|
$wp_version = '4.4-beta3-35584';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue