You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Within the handleSnap function there is scrollToOffset call
The amount to add or subtract from the current offset is a fixed number. This can result in a disproportionate amount of automatic scrolling during the snap. If the header bar has already been partially hidden then there will always be excess. Hence, the amount already hidden should be considered. Here is my solution const halfHeader = headerHeight / 2; const difference = halfHeader + translateYNumber.current; getCloser(translateYNumber.current, -headerHeight / 2, 0) === -headerHeight / 2 ? offsetY + difference : offsetY-(halfHeader-difference) });
The text was updated successfully, but these errors were encountered:
Within the handleSnap function there is scrollToOffset call
The amount to add or subtract from the current offset is a fixed number. This can result in a disproportionate amount of automatic scrolling during the snap. If the header bar has already been partially hidden then there will always be excess. Hence, the amount already hidden should be considered. Here is my solution
const halfHeader = headerHeight / 2;
const difference = halfHeader + translateYNumber.current;
getCloser(translateYNumber.current, -headerHeight / 2, 0) ===
-headerHeight / 2
? offsetY + difference
: offsetY-(halfHeader-difference)
});
The text was updated successfully, but these errors were encountered: