From f89855386580373381ed26a5b1f169dbe9993362 Mon Sep 17 00:00:00 2001 From: Lewis Hemens Date: Mon, 8 Jul 2024 21:27:19 +0100 Subject: [PATCH] Stop even propagation on text input fields (#310) --- client/drawer.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client/drawer.tsx b/client/drawer.tsx index 6cbff90..f02204d 100644 --- a/client/drawer.tsx +++ b/client/drawer.tsx @@ -559,6 +559,7 @@ function NewDrawingButton() { label="Drawing name" helperText={!validDrawingName && "Drawing name must be unique."} defaultValue={defaultNewDrawingName} + onKeyDown={(e) => e.stopPropagation()} onChange={(e) => setNewDrawingName(e.target.value)} /> @@ -603,6 +604,7 @@ function RenameDrawingButton({ drawingId }: { drawingId: DrawingId }) { label="Drawing name" helperText={!validDrawingName && "Drawing name already exists."} defaultValue={defaultNewDrawingName} + onKeyDown={e => e.stopPropagation()} onChange={(e) => setNewDrawingName(e.target.value)} /> @@ -662,6 +664,7 @@ function ForkDrawingButton({ label="Drawing name" helperText={!validDrawingName && "Drawing name already exists."} defaultValue={defaultNewDrawingName} + onKeyDown={(e) => e.stopPropagation()} onChange={(e) => setNewDrawingName(e.target.value)} />