Profile: Fix redundant scroll top animation
This commit is contained in:
parent
0d48faba2f
commit
2a2ae99ed3
@ -47,7 +47,7 @@ export default function useProfileState(
|
||||
}
|
||||
|
||||
const tabListEl = container.querySelector<HTMLDivElement>('.TabList');
|
||||
if (!tabListEl) {
|
||||
if (!tabListEl || tabListEl.offsetTop > container.scrollTop) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -7,6 +7,7 @@ import {
|
||||
FAST_SMOOTH_MAX_DISTANCE, FAST_SMOOTH_MAX_DURATION, FAST_SMOOTH_MIN_DURATION,
|
||||
FAST_SMOOTH_SHORT_TRANSITION_MAX_DISTANCE,
|
||||
} from '../config';
|
||||
import { IS_ANDROID } from './environment';
|
||||
import { dispatchHeavyAnimationEvent } from '../hooks/useHeavyAnimationCheck';
|
||||
import { animateSingle } from './animation';
|
||||
|
||||
@ -89,7 +90,7 @@ function scrollWithJs(
|
||||
|
||||
switch (position) {
|
||||
case 'start':
|
||||
path = (elementTop - margin) - scrollFrom;
|
||||
path = (elementTop - margin) - scrollFrom + (IS_ANDROID ? 1 : 0);
|
||||
break;
|
||||
case 'end':
|
||||
path = (elementTop + elementHeight + margin) - (scrollFrom + targetContainerHeight);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user