react-multi-email
react-multi-email copied to clipboard
Stop propagation enter
We used this input in forms, but when we pressed enter to add new email then form is submitted too.
I fixed code.
handleOnKeydown = (e: React.KeyboardEvent<HTMLInputElement>) => {
switch (e.which) {
case 13:
e.preventDefault();
break;
case 8:
if (!e.currentTarget.value) {
this.removeEmail(this.state.emails.length - 1);
}
break;
default:
}
};
Just released 0.4.4 Thanks for your contribution.
https://www.npmjs.com/package/react-multi-email
It works perfectly now, thanks for your time.