message: fix sticky tab header when content is not so high
diff: @@ -147,8 +147,7 @@ function useStickyHeaderPositioning({
  }) {
  const lockHeaderPosition = useAnimatedValue(1)
  - Animated.useCode(
  - () => {
  + Animated.useCode(() => {
  // scrollDiff is the amount the header has scrolled since last time this code ran
  const scrollDiff = Animated.diff(scrollOffsetY)
  @@ -189,18 +188,37 @@ function useStickyHeaderPositioning({
  Animated.and(notBouncingAtTheTop, notBouncingAtTheBottom),
  updateHeaderOffset,
  [
  - // deref scroll diff to prevent diff buildup when ignoring changes
  - scrollDiff,
  - // max out header position to avoid dropped diffs when the last frame was below a bounce threshold
  Animated.cond(
  notBouncingAtTheTop,
  [
  - // bouncing at the bottom, keep the header fully hidden
  - Animated.set(headerOffsetY, negative(headerHeight)),
  + // bouncing at the bottom,
  + // normally the header will be fully up at this point but sometimes
  + // the content is not tall enough to cause that, so we still need to
  + // update the header position just like above. The only difference is that
  + // when the bounce snaps back, we don't want to trigger opening the header
  + // like we do when the user explicitly scrolls back upward.
  + Animated.cond(
  + Animated.greaterThan(scrollDiff, 0),
  + [
  + // y offset got bigger so scrolling down (content travels up the screen)
  + Animated.set(
  + headerOffsetY,
  + Animated.max(negative(headerHeight), Animated.sub(headerOffsetY, scrollDiff))
  + ),
  + ],
  + [
  + // y offset got smaller so scrolling up (content travels down the screen)
  + Animated.cond(Animated.or(headerIsNotFullyUp, nearTheTop), [
  + Animated.set(headerOffsetY, Animated.min(0, Animated.sub(headerOffsetY, scrollDiff))),
  + ]),
  + ]
  + ),
  ],
  [
  // bouncing at the top, keep the header fully open
  Animated.set(headerOffsetY, 0),
  + // deref scroll diff to prevent diff buildup when ignoring changes
  + scrollDiff,
  ]
  ),
  ]
  @@ -224,9 +242,7 @@ function useStickyHeaderPositioning({
  ],
  updateHeaderOffsetWhenNotLocked
  )
  - },
  - [headerHeight]
  - )
  + }, [headerHeight])
  return { lockHeaderPosition }
  }
  