From f3618aaeb31b5b85530c097012127028cd9c06dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E8=B4=A7=E7=88=B1=E5=90=83=E7=99=BD=E8=90=9D?= =?UTF-8?q?=E5=8D=9C?= Date: Fri, 15 Nov 2024 14:51:43 +0800 Subject: [PATCH] enhance: not trigger scroll on ActionButton (#51647) --- components/_util/ActionButton.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/_util/ActionButton.tsx b/components/_util/ActionButton.tsx index 3e6de6e62c..6f28403763 100644 --- a/components/_util/ActionButton.tsx +++ b/components/_util/ActionButton.tsx @@ -52,7 +52,9 @@ const ActionButton: React.FC = (props) => { let timeoutId: ReturnType | null = null; if (autoFocus) { timeoutId = setTimeout(() => { - buttonRef.current?.focus(); + buttonRef.current?.focus({ + preventScroll: true, + }); }); } return () => {