From fc6f293398c5257517b9fc7c0d816073adfe7ecf Mon Sep 17 00:00:00 2001 From: iseulde Date: Sat, 11 May 2019 21:20:03 +0200 Subject: [PATCH] Update selection early for all left/right key presses --- .../block-editor/src/components/rich-text/index.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/block-editor/src/components/rich-text/index.js b/packages/block-editor/src/components/rich-text/index.js index c5782e46b409e..3b3fa6198b529 100644 --- a/packages/block-editor/src/components/rich-text/index.js +++ b/packages/block-editor/src/components/rich-text/index.js @@ -656,13 +656,13 @@ export class RichText extends Component { this.keyPressed = keyCode; - if ( - // Only override left and right keys without modifiers pressed. - ! shiftKey && ! altKey && ! metaKey && ! ctrlKey && - ( keyCode === LEFT || keyCode === RIGHT ) - ) { - this.handleHorizontalNavigation( event ); + if ( keyCode === LEFT || keyCode === RIGHT ) { this.updateSelection(); + + // Only override left and right keys without modifiers pressed. + if ( ! shiftKey && ! altKey && ! metaKey && ! ctrlKey ) { + this.handleHorizontalNavigation( event ); + } } // Use the space key in list items (at the start of an item) to indent