Make WordPress Core

Changeset 30407


Ignore:
Timestamp:
11/20/2014 11:05:18 AM (12 years ago)
Author:
nacin
Message:

Media Grid: when the modal is open, don't respond to arrow keys when <textarea> has focus.

Merges [29777] (and [30378]) to the 4.0 branch.

Props ryelle, adamsilverstein.
Fixes #29725.

Location:
branches/4.0
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.0

  • branches/4.0/src/wp-includes/js/media-grid.js

    r29625 r30407  
    578578                },
    579579                /**
    580                  * Respond to the keyboard events: right arrow, left arrow, escape.
     580                 * Respond to the keyboard events: right arrow, left arrow, except when
     581                 * focus is in a textarea or input field.
    581582                 */
    582583                keyEvent: function( event ) {
    583                         if ( 'INPUT' === event.target.tagName && ! ( event.target.readOnly || event.target.disabled ) ) {
     584                        if ( ( 'INPUT' === event.target.nodeName || 'TEXTAREA' === event.target.nodeName ) && ! ( event.target.readOnly || event.target.disabled ) ) {
    584585                                return;
    585586                        }
Note: See TracChangeset for help on using the changeset viewer.