Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

override onKeyDown #101

Open
edentsubery opened this issue Nov 30, 2022 · 5 comments
Open

override onKeyDown #101

edentsubery opened this issue Nov 30, 2022 · 5 comments

Comments

@edentsubery
Copy link

hello, I am new to react and am trying to override the handleOnKeydown function to work better with the rest on my components. I am unable to figure out how to do so. I am adding a copy of my code, please tell me if there is a way to override it

<ReactMultiEmail

                                             placeholder="Enter Email addresses of study buddies"
                                             emails={emails}

                                             onKeyDown={onKeyDown}
                                             autoFocus={true}
                                             onChange={(_emails: string[]) => {
                                                 this.setState({ emails: _emails });
                                             }}
                                             validateEmail={email => {
                                                 return isEmail(email); // return boolean
                                             }}
                                             getLabel={(
                                                 email: string,
                                                 index: number,
                                                 removeEmail: (index: number) => void,
                                             ) => {
                                                 return (
                                                     <div data-tag key={index}>
                                                         {email}
                                                         <span data-tag-handle onClick={
                                                             () => {removeEmail(index)
                                                                 this.onDelete(email)}
                                                         }>×</span>

                                                     </div>
                                                 );
                                             }}

                            />
@thomasJang
Copy link
Member

If you want to use onkeydown, I will add the code and upgrade the version, please try once the version is distributed.

@thomasJang
Copy link
Member

You can use v1.0.3

@edentsubery
Copy link
Author

thank you so much! I really appreciate the quick response :)

@jagdishjnext
Copy link

@thomasJang can i disable comma key?

@jagdishjnext
Copy link

i want to not add value when i entered comma key is it possible?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants