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. git-svn-id: https://develop.svn.wordpress.org/trunk@29481 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
4958fecdaf
commit
d48bee596a
|
@ -492,12 +492,18 @@
|
||||||
if ( $target.is( 'input' ) || $target.is( 'textarea' ) ) {
|
if ( $target.is( 'input' ) || $target.is( 'textarea' ) ) {
|
||||||
return event;
|
return event;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Escape key, while in the Edit Image mode
|
||||||
|
if ( 27 === event.keyCode ) {
|
||||||
|
this.modal.close();
|
||||||
|
}
|
||||||
|
|
||||||
// The right arrow key
|
// The right arrow key
|
||||||
if ( event.keyCode === 39 ) {
|
if ( 39 === event.keyCode ) {
|
||||||
this.nextMediaItem();
|
this.nextMediaItem();
|
||||||
}
|
}
|
||||||
// The left arrow key
|
// The left arrow key
|
||||||
if ( event.keyCode === 37 ) {
|
if ( 37 === event.keyCode ) {
|
||||||
this.previousMediaItem();
|
this.previousMediaItem();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue