From b6377c378f433116220edfaedf66078394b57189 Mon Sep 17 00:00:00 2001 From: Chip Snyder Date: Thu, 23 Jan 2020 11:46:26 -0500 Subject: [PATCH 1/3] Disable Autocomplete in shortcode block --- packages/block-library/src/shortcode/edit.native.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/block-library/src/shortcode/edit.native.js b/packages/block-library/src/shortcode/edit.native.js index ee39391f9b747b..32ca7e8048f1f4 100644 --- a/packages/block-library/src/shortcode/edit.native.js +++ b/packages/block-library/src/shortcode/edit.native.js @@ -1,7 +1,7 @@ /** * External dependencies */ -import { View, Text } from 'react-native'; +import { Platform, View, Text } from 'react-native'; /** * WordPress dependencies @@ -36,6 +36,9 @@ export function ShortcodeEdit( props ) { isSelected={ props.isSelected } onFocus={ onFocus } onBlur={ onBlur } + autoCorrect={ false } + autoComplete="off" + keyboardType={ Platform.OS === 'ios' ? "default" : "visible-password" } placeholderTextColor={ placeholderStyle.color } /> From a8515e468b08274e98d5d4e387f787845ba34686 Mon Sep 17 00:00:00 2001 From: Chip Snyder Date: Thu, 23 Jan 2020 14:44:34 -0500 Subject: [PATCH 2/3] Resolve lint errors --- packages/block-library/src/shortcode/edit.native.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/block-library/src/shortcode/edit.native.js b/packages/block-library/src/shortcode/edit.native.js index 32ca7e8048f1f4..fb05de04991a85 100644 --- a/packages/block-library/src/shortcode/edit.native.js +++ b/packages/block-library/src/shortcode/edit.native.js @@ -38,7 +38,7 @@ export function ShortcodeEdit( props ) { onBlur={ onBlur } autoCorrect={ false } autoComplete="off" - keyboardType={ Platform.OS === 'ios' ? "default" : "visible-password" } + keyboardType={ Platform.OS === 'ios' ? 'default' : 'visible-password' } placeholderTextColor={ placeholderStyle.color } /> From d995d3bd35902a563a70cfcdd91d732f0ebf7391 Mon Sep 17 00:00:00 2001 From: Chip Snyder Date: Mon, 27 Jan 2020 11:43:43 -0500 Subject: [PATCH 3/3] Adding comment for autocorrect changes --- packages/block-library/src/shortcode/edit.native.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/block-library/src/shortcode/edit.native.js b/packages/block-library/src/shortcode/edit.native.js index fb05de04991a85..67aa699836dbe1 100644 --- a/packages/block-library/src/shortcode/edit.native.js +++ b/packages/block-library/src/shortcode/edit.native.js @@ -38,6 +38,11 @@ export function ShortcodeEdit( props ) { onBlur={ onBlur } autoCorrect={ false } autoComplete="off" + /* + * For some devices autoCorrect and autoComplete are not enough to hide the suggestion toolbar. + * Following the suggestion below we added the keyboard type as well. + * https://stackoverflow.com/questions/37001070/how-to-avoid-the-suggestions-of-keyboard-for-android-in-react-native/51411575#51411575 + */ keyboardType={ Platform.OS === 'ios' ? 'default' : 'visible-password' } placeholderTextColor={ placeholderStyle.color } />