Skip to content

Commit

Permalink
Mobile - RichText - Restore onSelectionChange when its focused (#29074)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerardo Pacheco authored and Antonis Lilis committed Feb 17, 2021
1 parent 181da84 commit 064262f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/rich-text/src/component/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -756,6 +756,12 @@ export class RichText extends Component {

if ( isSelected && ! prevIsSelected ) {
this._editor.focus();
// Update selection props explicitly when component is selected as Aztec won't call onSelectionChange
// if its internal value hasn't change. When created, default value is 0, 0
this.onSelectionChange(
this.props.selectionStart || 0,
this.props.selectionEnd || 0
);
} else if ( ! isSelected && prevIsSelected ) {
this._editor.blur();
}
Expand Down

0 comments on commit 064262f

Please sign in to comment.