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:
Helen Hou-Sandí 2014-07-30 17:39:15 +00:00
parent aca4a37c1d
commit 2ca11ebf72
2 changed files with 12 additions and 1 deletions

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

File diff suppressed because one or more lines are too long