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 8ab8b55ee3c16e..49eed87f700596 100644 --- a/packages/block-editor/src/components/rich-text/index.native.js +++ b/packages/block-editor/src/components/rich-text/index.native.js @@ -501,7 +501,6 @@ export class RichText extends Component { style, formattingControls, isSelected, - sendEmptyTag, } = this.props; const record = this.getRecord(); @@ -509,22 +508,11 @@ export class RichText extends Component { const value = this.valueToFormat( record ); let html = `<${ tagName }>${ value }`; // We need to check if the value is undefined or empty, and then assign it properly otherwise the placeholder is not visible - if ( value === undefined || value === '' ) { - // PR for placeholder fix https://github.com/WordPress/gutenberg/pull/13699/ - // has introduced heading issue on Android https://github.com/wordpress-mobile/gutenberg-mobile/issues/627 - // ( If a new heading block is created on Android device - // it will be without default formatting (

currently ) ) . - // Fix for heading issue is to skip reset of html variable if tag is heading and platform is Android. - // This fix will intentionally introduce original issue with placeholder (on Android) - // which has lower priority then heading issue . - // New issue is raised : https://github.com/wordpress-mobile/gutenberg-mobile/issues/707 - if ( ! sendEmptyTag ) { - html = ''; - } - + html = ''; this.lastEventCount = undefined; // force a refresh on the native side } + let minHeight = styles[ 'editor-rich-text' ].minHeight; if ( style && style.minHeight ) { minHeight = style.minHeight; diff --git a/packages/block-library/src/heading/edit.native.js b/packages/block-library/src/heading/edit.native.js index ea1d371ddb23aa..78cb518945ebf1 100644 --- a/packages/block-library/src/heading/edit.native.js +++ b/packages/block-library/src/heading/edit.native.js @@ -16,6 +16,8 @@ import { Component } from '@wordpress/element'; import { RichText, BlockControls } from '@wordpress/block-editor'; import { createBlock } from '@wordpress/blocks'; +import styles from './editor.scss'; + const name = 'core/heading'; class HeadingEdit extends Component { @@ -23,7 +25,6 @@ class HeadingEdit extends Component { super( props ); this.splitBlock = this.splitBlock.bind( this ); - this.isAndroid = Platform.OS === 'android'; } /** @@ -94,7 +95,10 @@ class HeadingEdit extends Component { tagName={ tagName } value={ content } isSelected={ this.props.isSelected } - style={ style } + style={ { + ...style, + minHeight: styles['wp-block-heading'].minHeight, + } } onFocus={ this.props.onFocus } // always assign onFocus as a props onBlur={ this.props.onBlur } // always assign onBlur as a props onCaretVerticalPositionChange={ this.props.onCaretVerticalPositionChange } @@ -102,9 +106,6 @@ class HeadingEdit extends Component { onMerge={ mergeBlocks } onSplit={ this.splitBlock } placeholder={ placeholder || __( 'Write heading…' ) } - // Fix for heading issue on Android https://github.com/wordpress-mobile/gutenberg-mobile/issues/627 - // Intentionally introduces missing pleceholder issue on Android https://github.com/wordpress-mobile/gutenberg-mobile/issues/707 - sendEmptyTag={ this.isAndroid } /> ); diff --git a/packages/block-library/src/heading/editor.native.scss b/packages/block-library/src/heading/editor.native.scss new file mode 100644 index 00000000000000..eb3f5a7e691eb1 --- /dev/null +++ b/packages/block-library/src/heading/editor.native.scss @@ -0,0 +1,4 @@ + +.wp-block-heading { + min-height: $min-height-heading; +}