enhance: not trigger scroll on ActionButton (#51647)

This commit is contained in:
二货爱吃白萝卜 2024-11-15 14:51:43 +08:00 committed by GitHub
parent 6ee60ed3a1
commit f3618aaeb3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -52,7 +52,9 @@ const ActionButton: React.FC<ActionButtonProps> = (props) => {
let timeoutId: ReturnType<typeof setTimeout> | null = null;
if (autoFocus) {
timeoutId = setTimeout(() => {
buttonRef.current?.focus();
buttonRef.current?.focus({
preventScroll: true,
});
});
}
return () => {