diff --git a/packages/block-library/src/heading/edit.native.js b/packages/block-library/src/heading/edit.native.js index d21613cabe0982..ac751101fb1449 100644 --- a/packages/block-library/src/heading/edit.native.js +++ b/packages/block-library/src/heading/edit.native.js @@ -18,11 +18,6 @@ import { createBlock } from '@wordpress/blocks'; const name = 'core/heading'; -/** - * Internal dependencies - */ -import styles from './style.scss'; - class HeadingEdit extends Component { constructor( props ) { super( props ); @@ -30,7 +25,6 @@ class HeadingEdit extends Component { this.splitBlock = this.splitBlock.bind( this ); } - /** * Split handler for RichText value, namely when content is pasted or the * user presses the Enter key. @@ -79,7 +73,6 @@ class HeadingEdit extends Component { attributes, setAttributes, mergeBlocks, - insertBlocksAfter, style, } = this.props; diff --git a/packages/editor/src/components/rich-text/index.native.js b/packages/editor/src/components/rich-text/index.native.js index 5c707388ee4324..b291d211e46522 100644 --- a/packages/editor/src/components/rich-text/index.native.js +++ b/packages/editor/src/components/rich-text/index.native.js @@ -98,11 +98,11 @@ export class RichText extends Component { getRecord() { const { formatPlaceholder, start, end } = this.state; - var value = this.props.value === undefined ? null : this.props.value; + let value = this.props.value === undefined ? null : this.props.value; // Since we get the text selection from Aztec we need to be in sync with the HTML `value` // Removing leading white spaces using `trim()` should make sure this is the case. - if (typeof value === 'string' || value instanceof String) { + if ( typeof value === 'string' || value instanceof String ) { value = value.trimLeft(); } diff --git a/packages/format-library/src/link/modal.native.js b/packages/format-library/src/link/modal.native.js index 765cbb5b455d35..e9395085d07dd1 100644 --- a/packages/format-library/src/link/modal.native.js +++ b/packages/format-library/src/link/modal.native.js @@ -39,6 +39,7 @@ class ModalLinkUI extends Component { this.onChangeText = this.onChangeText.bind( this ); this.onChangeOpensInNewWindow = this.onChangeOpensInNewWindow.bind( this ); this.removeLink = this.removeLink.bind( this ); + this.onDismiss = this.onDismiss.bind( this ); this.state = { inputValue: '', @@ -109,13 +110,21 @@ class ModalLinkUI extends Component { this.props.onClose(); } + onDismiss() { + if ( this.state.inputValue === '' ) { + this.removeLink(); + } else { + this.submitLink(); + } + } + render() { const { isVisible } = this.props; return ( { /* eslint-disable jsx-a11y/no-autofocus */ @@ -126,7 +135,7 @@ class ModalLinkUI extends Component { placeholder={ __( 'Add URL' ) } autoCapitalize="none" autoCorrect={ false } - textContentType="URL" + keyboardType="url" onChangeValue={ this.onChangeInputValue } autoFocus={ Platform.OS === 'ios' } />