Merge pull request #16 from lbryio/uri-bar-spellcheck

disable spell check in uri bar
This commit is contained in:
Akinwale Ariwodola 2019-08-13 04:55:41 +01:00 committed by GitHub
commit 8b67a9fab8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,7 +3,7 @@ import React from 'react';
import { SEARCH_TYPES, isNameValid, isURIValid, normalizeURI } from 'lbry-redux'; import { SEARCH_TYPES, isNameValid, isURIValid, normalizeURI } from 'lbry-redux';
import { FlatList, Keyboard, TextInput, View } from 'react-native'; import { FlatList, Keyboard, TextInput, View } from 'react-native';
import { navigateToUri } from 'utils/helper'; import { navigateToUri } from 'utils/helper';
import Constants from 'constants'; import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
import UriBarItem from './internal/uri-bar-item'; import UriBarItem from './internal/uri-bar-item';
import NavigationButton from 'component/navigationButton'; import NavigationButton from 'component/navigationButton';
import discoverStyle from 'styles/discover'; import discoverStyle from 'styles/discover';
@ -49,7 +49,7 @@ class UriBar extends React.PureComponent {
} }
handleChangeText = text => { handleChangeText = text => {
const newValue = text ? text : ''; const newValue = text || '';
clearTimeout(this.state.changeTextTimeout); clearTimeout(this.state.changeTextTimeout);
const { updateSearchQuery, onSearchSubmitted, navigation } = this.props; const { updateSearchQuery, onSearchSubmitted, navigation } = this.props;
@ -144,7 +144,7 @@ class UriBar extends React.PureComponent {
let style = [uriBarStyle.overlay, belowOverlay ? null : uriBarStyle.overlayElevated]; let style = [uriBarStyle.overlay, belowOverlay ? null : uriBarStyle.overlayElevated];
// TODO: Add optional setting to enable URI / search bar suggestions // TODO: Add optional setting to enable URI / search bar suggestions
/*if (this.state.focused) { style.push(uriBarStyle.inFocus); }*/ /* if (this.state.focused) { style.push(uriBarStyle.inFocus); } */
return ( return (
<View style={style}> <View style={style}>
@ -160,11 +160,12 @@ class UriBar extends React.PureComponent {
ref={ref => { ref={ref => {
this.textInput = ref; this.textInput = ref;
}} }}
autoCorrect={false}
style={uriBarStyle.uriText} style={uriBarStyle.uriText}
onLayout={() => { onLayout={() => {
this.setSelection(); this.setSelection();
}} }}
selectTextOnFocus={true} selectTextOnFocus
placeholder={'Search movies, music, and more'} placeholder={'Search movies, music, and more'}
underlineColorAndroid={'transparent'} underlineColorAndroid={'transparent'}
numberOfLines={1} numberOfLines={1}