WordPress.org

Make WordPress Core

Changeset 29331


Ignore:
Timestamp:
07/30/2014 05:38:18 PM (6 years ago)
Author:
helen
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/media-views.js

    r29312 r29331  
    47534753            var method;
    47544754
     4755            // Don't do anything inside inputs.
     4756            if ( 'input' === event.target.tagName.toLowerCase() ) {
     4757                return
     4758            }
     4759
    47554760            // Catch arrow events
    47564761            if ( 37 === event.keyCode || 38 === event.keyCode || 39 === event.keyCode || 40 === event.keyCode ) {
     
    47684773                // Pass the current target to restore focus when closing
    47694774                this.controller.trigger( 'edit:attachment', this.model, event.currentTarget );
     4775
     4776                // Don't scroll the view and don't attempt to submit anything.
     4777                event.stopPropagation();
    47704778                return;
    47714779            }
     
    47804788                method: method
    47814789            });
     4790
     4791            // Don't scroll the view and don't attempt to submit anything.
     4792            event.stopPropagation();
    47824793        },
    47834794        /**
Note: See TracChangeset for help on using the changeset viewer.