From 60f0d20965637d87e8ff49705b7b2f36686f51d9 Mon Sep 17 00:00:00 2001 From: Pascal Breuninger Date: Tue, 14 Jan 2025 18:42:01 +0100 Subject: [PATCH] fix(desktop): prevent scroll event from increasing/decreasing number input --- .../Pro/CreateWorkspace/InfrastructureTemplateInput.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/desktop/src/views/Pro/CreateWorkspace/InfrastructureTemplateInput.tsx b/desktop/src/views/Pro/CreateWorkspace/InfrastructureTemplateInput.tsx index b94b639eb..9a09e06e2 100644 --- a/desktop/src/views/Pro/CreateWorkspace/InfrastructureTemplateInput.tsx +++ b/desktop/src/views/Pro/CreateWorkspace/InfrastructureTemplateInput.tsx @@ -284,6 +284,11 @@ function OptionFormField({ spellCheck={false} placeholder={placeholder ?? `Enter ${displayName}`} type="number" + onWheel={(e) => { + // This prevents the input field from increasing/decreasing the numbers when the scroll event is captured + // while this input field is focused + ;(e.target as HTMLInputElement).blur() + }} {...props} /> )