mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
Media: Fix focus loss when closing Image Rotation menu.
Only shift focus into menu when opening the menu. Check `aria-expanded` value of toggle before moving focus. Props joedolson. Fixes #59353. git-svn-id: https://develop.svn.wordpress.org/trunk@56591 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
73d839264f
commit
227fdb8b74
@ -236,8 +236,10 @@
|
||||
// Open menu and set z-index to appear above image crop area if it is enabled.
|
||||
$target
|
||||
.toggleClass( 'imgedit-popup-menu-open' ).slideToggle( 'fast' ).css( { 'z-index' : 200000 } );
|
||||
// Move focus to first item in menu.
|
||||
$target.find( 'button' ).first().trigger( 'focus' );
|
||||
// Move focus to first item in menu when opening menu.
|
||||
if ( 'true' === $el.attr( 'aria-expanded' ) ) {
|
||||
$target.find( 'button' ).first().trigger( 'focus' );
|
||||
}
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user