jwohlfert23 / react-native-tag-input

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

Need help gettting this working pls? #24

Closed adamgins closed 7 years ago

adamgins commented 7 years ago

Hi trying to get this working but seem to be struggling, any help appreciated:

                        <TagInput
                            value={['one', 'two']}
                            onChange={(emails) => this.onEmailChange(emails)} 

                        />

the onEmailChange just has a console.log:

 onEmailChange (emails){
        console.log(emails);
    }

I get the following rendered:

screen shot 2017-02-03 at 4 23 30 pm

I have a few issues: 1) When I click one console log renders two 2) typing in the type somehting field where I have ssssas seems to have no impact whatssoever.

Any help appreciated

thanks

sidutta commented 7 years ago

I'm facing the same issue too.

sidutta commented 7 years ago

For anyone else who encounters this problem, this happens because the version available through npm is not the same the one here on git.

const regex = this.props.regex || /([a-zA-Z0-9.-]+@[a-zA-Z0-9.-]+.[a-zA-Z0-9._-]+)/gi;

is the check in the npm code. Thus, only email addresses are accepted as valid tags.

jwohlfert23 commented 7 years ago

I'll publish the latest version right now. Sorry about that.

jwohlfert23 commented 7 years ago

Try now.

sidutta commented 7 years ago

Yes, it's working fine now. Thanks!