Skip to content

Commit

Permalink
Avoid re-rendering the EditorRegions component on click (#18776)
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Nov 29, 2019
1 parent 6b5c1e9 commit 5507ce8
Showing 1 changed file with 7 additions and 2 deletions.
Expand Up @@ -48,11 +48,16 @@ export default createHigherOrderComponent(
}

nextRegion.focus();
this.setState( { isFocusingRegions: true } );

if ( ! this.state.isFocusingRegions ) {
this.setState( { isFocusingRegions: true } );
}
}

onClick() {
this.setState( { isFocusingRegions: false } );
if ( this.state.isFocusingRegions ) {
this.setState( { isFocusingRegions: false } );
}
}

render() {
Expand Down

0 comments on commit 5507ce8

Please sign in to comment.