In the Edit Attachment frame, when in Edit Image mode, add a key event for Escape. There are conflicting `keydown` handlers that don't propagate the event to the modal properly.
Fixes #29121. Built from https://develop.svn.wordpress.org/trunk@29481 git-svn-id: http://core.svn.wordpress.org/trunk@29259 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
2943f5384c
commit
ca03604712
|
@ -492,12 +492,18 @@
|
|||
if ( $target.is( 'input' ) || $target.is( 'textarea' ) ) {
|
||||
return event;
|
||||
}
|
||||
|
||||
// Escape key, while in the Edit Image mode
|
||||
if ( 27 === event.keyCode ) {
|
||||
this.modal.close();
|
||||
}
|
||||
|
||||
// The right arrow key
|
||||
if ( event.keyCode === 39 ) {
|
||||
if ( 39 === event.keyCode ) {
|
||||
this.nextMediaItem();
|
||||
}
|
||||
// The left arrow key
|
||||
if ( event.keyCode === 37 ) {
|
||||
if ( 37 === event.keyCode ) {
|
||||
this.previousMediaItem();
|
||||
}
|
||||
},
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue