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.

git-svn-id: https://develop.svn.wordpress.org/trunk@29331 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Helen Hou-Sandi 2014-07-30 17:38:18 +00:00
parent 6be5fc19b3
commit 8790d81cb4

View File

@ -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