From c5e466c40f4f7ed9b715ff0ed0af1b99929ef283 Mon Sep 17 00:00:00 2001 From: Gerardo Date: Tue, 11 Jun 2024 17:35:33 +0200 Subject: [PATCH 1/2] Native RichText - Fix undefined onDelete callback --- .../src/components/rich-text/native/index.native.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/block-editor/src/components/rich-text/native/index.native.js b/packages/block-editor/src/components/rich-text/native/index.native.js index aa06c4dd1e892..4eeaabe6d790a 100644 --- a/packages/block-editor/src/components/rich-text/native/index.native.js +++ b/packages/block-editor/src/components/rich-text/native/index.native.js @@ -424,7 +424,9 @@ export class RichText extends Component { return; } - onDelete( { isReverse, value } ); + if ( onDelete ) { + onDelete( { isReverse, value } ); + } event.preventDefault(); this.lastAztecEventType = 'input'; From db9adf722f49416f02426a3b470b3e932fe46152 Mon Sep 17 00:00:00 2001 From: Gerardo Date: Tue, 11 Jun 2024 17:51:39 +0200 Subject: [PATCH 2/2] Update changelog --- packages/react-native-editor/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/react-native-editor/CHANGELOG.md b/packages/react-native-editor/CHANGELOG.md index 44f5b63bd1f4d..f5c43f4207ac5 100644 --- a/packages/react-native-editor/CHANGELOG.md +++ b/packages/react-native-editor/CHANGELOG.md @@ -10,6 +10,7 @@ For each user feature we should also add a importance categorization label to i --> ## Unreleased +- [*] RichText - Fix undefined onDelete callback [#62486] ## 1.120.0 - [*] Prevent deleting content when backspacing in the first Paragraph block [#62069]