diff --git a/packages/react-native-editor/CHANGELOG.md b/packages/react-native-editor/CHANGELOG.md index cd464e5021adf3..0923f84f9bb0a3 100644 --- a/packages/react-native-editor/CHANGELOG.md +++ b/packages/react-native-editor/CHANGELOG.md @@ -13,6 +13,7 @@ For each user feature we should also add a importance categorization label to i - [*] Add 'Insert from URL' option to Video block [#41493] - [*] Image block copies the alt text from the media library when selecting an item [#41839] +- [**] RichText - Improve performance by dropping events during quick typing [#41682] ## 1.78.1 diff --git a/packages/rich-text/src/component/index.native.js b/packages/rich-text/src/component/index.native.js index ce6ae2327cf69e..1688c0703403fc 100644 --- a/packages/rich-text/src/component/index.native.js +++ b/packages/rich-text/src/component/index.native.js @@ -657,6 +657,15 @@ export class RichText extends Component { return; } + // Check for and discard events during quick typing. Updating the selection during quick typing isn't + // necessary and can cause UI lags. (see https://github.com/WordPress/gutenberg/pull/41682.) + if ( + contentWithoutRootTag !== this.value && + this.lastAztecEventType === 'selection change' + ) { + return; + } + this.comesFromAztec = true; this.firedAfterTextChanged = true; // Selection change event always fires after the fact.