From 94ed3ea7a1485d8cefbe647af45e5a71692f06a2 Mon Sep 17 00:00:00 2001 From: Xiao Yijun Date: Tue, 18 Oct 2022 20:33:20 +0800 Subject: [PATCH] refactor(console): avoid jumping when the language item is visible (#2188) --- .../components/ManageLanguage/LanguageEditor/LanguageItem.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/console/src/pages/SignInExperience/components/ManageLanguage/LanguageEditor/LanguageItem.tsx b/packages/console/src/pages/SignInExperience/components/ManageLanguage/LanguageEditor/LanguageItem.tsx index cf1a8461b..1a328a69a 100644 --- a/packages/console/src/pages/SignInExperience/components/ManageLanguage/LanguageEditor/LanguageItem.tsx +++ b/packages/console/src/pages/SignInExperience/components/ManageLanguage/LanguageEditor/LanguageItem.tsx @@ -17,7 +17,7 @@ const LanguageItem = ({ languageTag, isSelected, onClick }: Props) => { useEffect(() => { if (isSelected) { - itemRef.current?.scrollIntoView(false); + itemRef.current?.scrollIntoView({ block: 'nearest', behavior: 'smooth' }); } }, [isSelected]);