react-multi-email
react-multi-email copied to clipboard
override onKeyDown
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>
);
}}
/>
If you want to use onkeydown, I will add the code and upgrade the version, please try once the version is distributed.
You can use v1.0.3
thank you so much! I really appreciate the quick response :)
@thomasJang can i disable comma key?
i want to not add value when i entered comma key is it possible?