소스 검색

Prevent default on Chips

Tatiana Inama 6 년 전
부모
커밋
bf453f233f
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  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]));
     }
   }