From 480e363240af53cc0d172d2a9954adc65b4b37cc Mon Sep 17 00:00:00 2001 From: Gerardo Pacheco Date: Wed, 12 Jun 2024 18:01:45 +0200 Subject: [PATCH] [Mobile] - RichText - Fix `undefined` onDelete callback (#62486) * Native RichText - Fix undefined onDelete callback * Update changelog Co-authored-by: geriux Co-authored-by: twstokes --- .../src/components/rich-text/native/index.native.js | 4 +++- packages/react-native-editor/CHANGELOG.md | 1 + 2 files changed, 4 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 aa06c4dd1e8926..4eeaabe6d790aa 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'; diff --git a/packages/react-native-editor/CHANGELOG.md b/packages/react-native-editor/CHANGELOG.md index 1a923d19dab256..07dbe7a2459958 100644 --- a/packages/react-native-editor/CHANGELOG.md +++ b/packages/react-native-editor/CHANGELOG.md @@ -12,6 +12,7 @@ For each user feature we should also add a importance categorization label to i ## Unreleased - [internal] Fix Inserter items list filtering [#62334] - [*] Prevent hiding the keyboard when creating new list items [#62446] +- [*] RichText - Fix undefined onDelete callback [#62486] ## 1.120.0 - [*] Prevent deleting content when backspacing in the first Paragraph block [#62069]