From aea253a59b1eb2fe9943f025dcbb28f734911854 Mon Sep 17 00:00:00 2001 From: Rahuletto Date: Mon, 3 Jul 2023 12:16:01 +0000 Subject: [PATCH] file select component was weird. fixed --- components/EditModal.tsx | 5 +++-- components/FileSelect.tsx | 3 ++- pages/index.tsx | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/components/EditModal.tsx b/components/EditModal.tsx index be5d10a..d1e2d40 100644 --- a/components/EditModal.tsx +++ b/components/EditModal.tsx @@ -1,5 +1,5 @@ // ReactJS stuff -import { ChangeEvent } from 'react'; +import { ChangeEvent, FormEvent } from 'react'; // Our Imports import { BoardFile } from '../utils/board'; @@ -30,8 +30,9 @@ const EditModal: React.FC = ({ back.style['display'] = 'none'; } - function edit(event) { + function edit(event: FormEvent) { event.preventDefault(); + event.stopPropagation() closeEdit(); const input = document.querySelector( diff --git a/components/FileSelect.tsx b/components/FileSelect.tsx index e17c79a..daa57cc 100644 --- a/components/FileSelect.tsx +++ b/components/FileSelect.tsx @@ -28,12 +28,13 @@ const FileSelect: React.FC = ({ return (
setFileName(file.name)} className={ file.name === fileName ? 'fileSelect active-file' : 'fileSelect' }> diff --git a/pages/index.tsx b/pages/index.tsx index a79a8de..88c7746 100755 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -403,7 +403,7 @@ const Index: NextPage = () => {