Skip to content

Commit

Permalink
Fix annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Apr 11, 2019
1 parent ccaa94d commit 18f4c57
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/block-editor/src/components/rich-text/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,9 @@ export class RichText extends Component {
}
}

const { formats, activeFormats = [], start, end } = this.getRecord();
const record = this.getRecord();
const { activeFormats = [], start, end } = record;
const formats = createPrepareEditableTree( this.props )( record );
const value = this.createRecord();

let newFormats;
Expand Down Expand Up @@ -750,7 +752,7 @@ export class RichText extends Component {
*/
handleHorizontalNavigation( event ) {
const value = this.getRecord();
const { formats, text, start, end } = value;
const { text, start, end } = value;
const { activeFormats = [] } = this.state;
const collapsed = isCollapsed( value );
const isReverse = event.keyCode === LEFT;
Expand Down Expand Up @@ -779,6 +781,7 @@ export class RichText extends Component {
// In all other cases, prevent default behaviour.
event.preventDefault();

const formats = createPrepareEditableTree( this.props )( value );
const formatsBefore = formats[ start - 1 ] || [];
const formatsAfter = formats[ start ] || [];

Expand Down

0 comments on commit 18f4c57

Please sign in to comment.