jwohlfert23 / react-native-tag-input

A simple React Native component that creates an input for tags, emails, etc.
MIT License
231 stars 104 forks source link

If we do click on Spacebar, It should not produce the empty content. ANY SOLUTION ?? #83

Open workninja19 opened 4 years ago

workninja19 commented 4 years ago

IMG_20200628_210540

jwilld commented 3 years ago

Are you still having this issue?

NoorAhmed407 commented 2 years ago

onChangeText={(text) =>onChangeTagValue(text)}

//OnChangeTagValue Function

const onChangeTagValue = (val)=>{
    let lastCharacter = val.charAt(val.length - 1);
    if(lastCharacter == " " && val.trim().length){
        setTagText('');
        setTags([...tags,val.trim()]);
    }
    else{
        setTagText(val);
    }
}