WordPress.org

Make WordPress Core

Changeset 33622


Ignore:
Timestamp:
08/17/2015 02:50:42 PM (4 years ago)
Author:
obenland
Message:

Editor: Exclude shift from modifier keys when handling spacebar shortcuts.

Patterns that activate on enter are still canceled with any modifier active.

Props azaozz.
Fixes #33382.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/tinymce/plugins/wptextpattern/plugin.js

    r33563 r33622  
    4545
    4646        editor.on( 'keyup', function( event ) {
    47             if ( ! VK.modifierPressed( event ) ) {
    48                 if ( event.keyCode === VK.SPACEBAR ) {
    49                     space();
    50                 } else if ( event.keyCode === VK.ENTER ) {
    51                     enter();
    52                 }
     47            if ( event.keyCode === VK.SPACEBAR && ! event.ctrlKey && ! event.metaKey && ! event.altKey ) {
     48                space();
     49            } else if ( event.keyCode === VK.ENTER && ! VK.modifierPressed( event ) ) {
     50                enter();
    5351            }
    5452        } );
Note: See TracChangeset for help on using the changeset viewer.