Skip to content

Commit

Permalink
Disable Autocomplete in shortcode block (#19848)
Browse files Browse the repository at this point in the history
* Disable Autocomplete in shortcode block
  • Loading branch information
chipsnyder authored and maxme committed Jan 28, 2020
1 parent 6f97e52 commit 6aa04e8
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/block-library/src/shortcode/edit.native.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { View, Text } from 'react-native';
import { Platform, View, Text } from 'react-native';

/**
* WordPress dependencies
Expand Down Expand Up @@ -36,6 +36,14 @@ export function ShortcodeEdit( props ) {
isSelected={ props.isSelected }
onFocus={ onFocus }
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 }
/>
</View>
Expand Down

0 comments on commit 6aa04e8

Please sign in to comment.