From 0cdd5ac9a1f208797619c8282e8fe3cc547c9613 Mon Sep 17 00:00:00 2001 From: Ai Ling <50992674+ailing35@users.noreply.github.com> Date: Mon, 7 Nov 2022 19:13:14 +0800 Subject: [PATCH] [ui][text input] Fix number input changing on scroll (#527) * [ui][text input] Fix number input changing on scroll * [ui][text input] Add comment --- packages/ui/src/TextInput/TextInput.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/ui/src/TextInput/TextInput.tsx b/packages/ui/src/TextInput/TextInput.tsx index 6765f132..74336772 100644 --- a/packages/ui/src/TextInput/TextInput.tsx +++ b/packages/ui/src/TextInput/TextInput.tsx @@ -198,6 +198,8 @@ function TextInput( onChange(event.target.value, event); }} + // To prevent scrolling from changing number input value + onWheel={(event) => event.currentTarget.blur()} {...props} /> {(() => {