Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16750

Cannot turn autoCorrect to {false} in react native TextInput

$
0
0

On my TextInput change text, I detect whether the user pushed the @ button for mentions.

onChangeText(text){    const suggestTrigger = text.match(/\B@[A-Za-z0-9]*$/i) //grab "@" trigger    const searchQuery = (suggestTrigger && suggestTrigger.length > 0) ? suggestTrigger[0] : null;    this.setState({        searchQuery: searchQuery    })}

Then, in my render, I do:

<TextInput     autoCapitalize={this.state.searchQuery ? "none" : "sentences"}    autoCorrect={this.state.searchQuery ? false : true}    onChangeText={this.onChangeText}/>

However, even when I do this, the autoCorrect does not turn off.

I still see this:

enter image description here

This is causing problems because oftentimes the system replaces the entire mention with a different word altogether.

How can I turn autoCorrect and autoCapitalize off when the user pushes the @ button?'I have even tried rendering an entirely different , but the behavior remains.


Viewing all articles
Browse latest Browse all 16750

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>