JoeRoddy / react-native-tag-autocomplete

React Native Tag Autocompletion
69 stars 26 forks source link

Tag not created if the user place the pointer in-between the word and clicks space #9

Closed nihp closed 6 years ago

nihp commented 6 years ago

If the user place the pointer in-between any word and click on the space means, it not create the tag.

createTagOnSpace ={true} not worked here. screen shot 2018-07-12 at 5 07 54 pm

JoeRoddy commented 6 years ago

This is the intended behavior. createTagOnSpace will only work if it's the last space.

If you want to change that, you could fork the repo and change line 52 of index.js

Right now it just checks if the last character is a space. So you'd want it to check if any char is a space. You would probably want to change it to something like:

.... &&  text.includes(" ") ) {
 //create tag 
}