Skip to content

Commit

Permalink
Update selection early for all left/right key presses
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed May 14, 2019
1 parent 3d9ffe7 commit fc6f293
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/block-editor/src/components/rich-text/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fc6f293

Please sign in to comment.