From eea1678cd3ee2615546f030d2fd47f673bb164ae Mon Sep 17 00:00:00 2001 From: Konstantin Obenland Date: Mon, 17 Aug 2015 14:50:42 +0000 Subject: [PATCH] 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. git-svn-id: https://develop.svn.wordpress.org/trunk@33622 602fd350-edb4-49c9-b593-d223f7449a82 --- .../js/tinymce/plugins/wptextpattern/plugin.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/wp-includes/js/tinymce/plugins/wptextpattern/plugin.js b/src/wp-includes/js/tinymce/plugins/wptextpattern/plugin.js index 8343e632b9..6c894237d8 100644 --- a/src/wp-includes/js/tinymce/plugins/wptextpattern/plugin.js +++ b/src/wp-includes/js/tinymce/plugins/wptextpattern/plugin.js @@ -44,12 +44,10 @@ }, true ); editor.on( 'keyup', function( event ) { - if ( ! VK.modifierPressed( event ) ) { - if ( event.keyCode === VK.SPACEBAR ) { - space(); - } else if ( event.keyCode === VK.ENTER ) { - enter(); - } + if ( event.keyCode === VK.SPACEBAR && ! event.ctrlKey && ! event.metaKey && ! event.altKey ) { + space(); + } else if ( event.keyCode === VK.ENTER && ! VK.modifierPressed( event ) ) { + enter(); } } );