From 1dddab40b2ede5737e615390e6a41daaa27c4461 Mon Sep 17 00:00:00 2001 From: Stefanos Togkoulidis Date: Wed, 1 May 2019 00:00:50 +0300 Subject: [PATCH] Have Aztec delete the detected Enter key for paragraphs Aztec-Android doesn't swallow the Enter key (like the list handling does) so, instruct Aztec to delete it for the paragraph block. --- packages/block-editor/src/components/rich-text/index.native.js | 1 + packages/block-library/src/paragraph/edit.native.js | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/block-editor/src/components/rich-text/index.native.js b/packages/block-editor/src/components/rich-text/index.native.js index 78afefa2f4ef7..757676051a9f5 100644 --- a/packages/block-editor/src/components/rich-text/index.native.js +++ b/packages/block-editor/src/components/rich-text/index.native.js @@ -731,6 +731,7 @@ export class RichText extends Component { text={ { text: html, eventCount: this.lastEventCount, selection } } placeholder={ this.props.placeholder } placeholderTextColor={ this.props.placeholderTextColor || styles[ 'block-editor-rich-text' ].textDecorationColor } + deleteEnter={ this.props.deleteEnter } onChange={ this.onChange } onFocus={ this.onFocus } onBlur={ this.onBlur } diff --git a/packages/block-library/src/paragraph/edit.native.js b/packages/block-library/src/paragraph/edit.native.js index 12abc71c8d22b..e7eafbac1797c 100644 --- a/packages/block-library/src/paragraph/edit.native.js +++ b/packages/block-library/src/paragraph/edit.native.js @@ -125,6 +125,7 @@ class ParagraphEdit extends Component { isSelected={ this.props.isSelected } onFocus={ this.props.onFocus } // always assign onFocus as a props onBlur={ this.props.onBlur } // always assign onBlur as a props + deleteEnter={ true } style={ style } onChange={ ( nextContent ) => { setAttributes( {