diff --git a/packages/block-editor/src/components/rich-text/index.js b/packages/block-editor/src/components/rich-text/index.js index fc82248f4b2ec..d14cfd156d1b0 100644 --- a/packages/block-editor/src/components/rich-text/index.js +++ b/packages/block-editor/src/components/rich-text/index.js @@ -366,7 +366,6 @@ function RichTextWrapper( { onEnter={ onEnter } onDelete={ onDelete } onPaste={ onPaste } - __unstableIsSelected={ originalIsSelected } __unstableInputRule={ inputRule } __unstableMultilineTag={ multilineTag } __unstableIsCaretWithinFormattedText={ isCaretWithinFormattedText } diff --git a/packages/rich-text/src/component/index.js b/packages/rich-text/src/component/index.js index 5b1c1db7b2425..4da176545509a 100644 --- a/packages/rich-text/src/component/index.js +++ b/packages/rich-text/src/component/index.js @@ -742,7 +742,6 @@ class RichText extends Component { selectionStart, selectionEnd, placeholder, - __unstableIsSelected: isSelected, } = this.props; // Check if the content changed. @@ -754,7 +753,7 @@ class RichText extends Component { // Check if the selection changed. shouldReapply = shouldReapply || ( - isSelected && ! prevProps.isSelected && ( + selectionStart && ! prevProps.selectionStart && ( this.record.start !== selectionStart || this.record.end !== selectionEnd ) @@ -920,11 +919,12 @@ class RichText extends Component { render() { const { - __unstableIsSelected: isSelected, + selectionStart, children, allowedFormats, withoutInteractiveFormatting, } = this.props; + const isSelected = selectionStart !== undefined; return ( <>