From 4cb526a1cebf216981fc86733792a2238dc1390d Mon Sep 17 00:00:00 2001 From: NriotHrreion Date: Sat, 4 Jan 2025 16:13:55 +0800 Subject: [PATCH] fix: Prevent keyboard shortcuts from triggering in input fields --- src/ui/panel/panel.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ui/panel/panel.tsx b/src/ui/panel/panel.tsx index d7bfb16..70eb4d3 100644 --- a/src/ui/panel/panel.tsx +++ b/src/ui/panel/panel.tsx @@ -136,6 +136,8 @@ export class Panel extends Component implements IP })); document.body.addEventListener("keydown", (e) => { + if(e.target instanceof HTMLInputElement || e.target instanceof HTMLTextAreaElement) return; + const code = e.key.charCodeAt(0); if(code >= 48 && code <= 57) { // 0-9