mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-22 14:35:07 +00:00
Prevent key event handlers from firing when in input areas in the media modal, as people understandably want to type inside said inputs. props kovshenin. fixes #28704.
Built from https://develop.svn.wordpress.org/trunk@29331 git-svn-id: http://core.svn.wordpress.org/trunk@29111 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
aca4a37c1d
commit
2ca11ebf72
@ -4752,6 +4752,11 @@
|
||||
toggleSelectionHandler: function( event ) {
|
||||
var method;
|
||||
|
||||
// Don't do anything inside inputs.
|
||||
if ( 'input' === event.target.tagName.toLowerCase() ) {
|
||||
return
|
||||
}
|
||||
|
||||
// Catch arrow events
|
||||
if ( 37 === event.keyCode || 38 === event.keyCode || 39 === event.keyCode || 40 === event.keyCode ) {
|
||||
this.arrowEvent(event);
|
||||
@ -4767,6 +4772,9 @@
|
||||
if ( this.controller.isModeActive( 'grid' ) ) {
|
||||
// Pass the current target to restore focus when closing
|
||||
this.controller.trigger( 'edit:attachment', this.model, event.currentTarget );
|
||||
|
||||
// Don't scroll the view and don't attempt to submit anything.
|
||||
event.stopPropagation();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -4779,6 +4787,9 @@
|
||||
this.toggleSelection({
|
||||
method: method
|
||||
});
|
||||
|
||||
// Don't scroll the view and don't attempt to submit anything.
|
||||
event.stopPropagation();
|
||||
},
|
||||
/**
|
||||
* @param {Object} event
|
||||
|
2
wp-includes/js/media-views.min.js
vendored
2
wp-includes/js/media-views.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user