Skip to content

override onKeyDown #101

Description

@edentsubery

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>
                                                 );
                                             }}

                            />

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions