Skip to content

Commit

Permalink
RichText: Revert removing isSelected from block context (#15698)
Browse files Browse the repository at this point in the history
Removing it generates a regression where inserting a new list block, the block is not selected
  • Loading branch information
etoledom authored May 17, 2019
1 parent 8160f88 commit 0e05d0c
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -821,12 +821,16 @@ RichText.defaultProps = {

const RichTextContainer = compose( [
withInstanceId,
withBlockEditContext( ( { clientId, onFocus, onCaretVerticalPositionChange }, ownProps ) => {
// ownProps.onFocus needs precedence over the block edit context
withBlockEditContext( ( { clientId, onFocus, onCaretVerticalPositionChange, isSelected }, ownProps ) => {
// ownProps.onFocus and isSelected needs precedence over the block edit context
if ( ownProps.isSelected !== undefined ) {
isSelected = ownProps.isSelected;
}
if ( ownProps.onFocus !== undefined ) {
onFocus = ownProps.onFocus;
}
return {
isSelected,
clientId,
onFocus,
onCaretVerticalPositionChange,
Expand Down

0 comments on commit 0e05d0c

Please sign in to comment.