Explorar o código

Prevent default on Chips

Tatiana Inama %!s(int64=6) %!d(string=hai) anos
pai
achega
bf453f233f
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      recipes/src/components/TagInput/index.tsx

+ 1 - 0
recipes/src/components/TagInput/index.tsx

@@ -30,6 +30,7 @@ export const TagInput:FunctionComponent<TagInputProps> = ({ label, onNewTag, tag
   const handleKeyDown = (e: any) => {
     const label = e.target.value;
     if (!!label && e.key === 'Enter') {
+      e.preventDefault();
       updateTags(uniq([...tags, label]));
     }
   }