0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00

refactor(console): avoid jumping when the language item is visible (#2188)

This commit is contained in:
Xiao Yijun 2022-10-18 20:33:20 +08:00 committed by GitHub
parent 647758bdd2
commit 94ed3ea7a1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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]);