TinyMCE, inline link: Fix VoiceOver in Safari for search suggestions.

Merge of [37228] to the 4.5 branch.

Props afercia.
Fixes #36458.
Built from https://develop.svn.wordpress.org/branches/4.5@37246


git-svn-id: http://core.svn.wordpress.org/branches/4.5@37212 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dominik Schilling 2016-04-19 20:48:28 +00:00
parent f0152dc74c
commit 9141a73031
4 changed files with 19 additions and 3 deletions

View File

@ -440,10 +440,26 @@
$input.autocomplete( 'search' ); $input.autocomplete( 'search' );
} }
} ) } )
// Returns a jQuery object containing the menu element.
.autocomplete( 'widget' ) .autocomplete( 'widget' )
.addClass( 'wplink-autocomplete' ) .addClass( 'wplink-autocomplete' )
.attr( 'role', 'listbox' ) .attr( 'role', 'listbox' )
.removeAttr( 'tabindex' ); // Remove the `tabindex=0` attribute added by jQuery UI. .removeAttr( 'tabindex' ) // Remove the `tabindex=0` attribute added by jQuery UI.
/*
* Looks like Safari and VoiceOver need an `aria-selected` attribute. See ticket #33301.
* The `menufocus` and `menublur` events are the same events used to add and remove
* the `ui-state-focus` CSS class on the menu items. See jQuery UI Menu Widget.
*/
.on( 'menufocus', function( event, ui ) {
ui.item.attr( 'aria-selected', 'true' );
})
.on( 'menublur', function() {
/*
* The `menublur` event returns an object where the item is `null`
* so we need to find the active item with other means.
*/
$( this ).find( '[aria-selected="true"]' ).removeAttr( 'aria-selected' );
});
} }
tinymce.$( input ).on( 'keydown', function( event ) { tinymce.$( input ).on( 'keydown', function( event ) {

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.5.1-alpha-37245'; $wp_version = '4.5.1-alpha-37246';
/** /**
* 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.