Skip to content

Commit d754bde

Browse files
kaciebfacebook-github-bot
authored andcommitted
Fix ScrollViewStickyHeader to push up header above it
Summary: When there are multiple sticky headers, ScrollViewStickyHeader should push up the header above it when it gets to the top. This behavior was accidentally changed in D21948830 (fa5d3fb) when this component was fixed to work in Fabric. This diff added a new variable `_shouldRecreateTranslateY`, which determines whether the `translateY` value should be recreated on render. `_shouldRecreateTranslateY` was not being set to true during `setNextHeaderY`, so the next header's Y value was never accounted for at render. Changelog: [General][Fixed] Fix ScrollViewStickyHeader to push up header above it Reviewed By: lunaleaps Differential Revision: D27277829 fbshipit-source-id: 83c9aacd454be178649bf8d060d1a5c750f4060f
1 parent 24f9f75 commit d754bde

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Libraries/Components/ScrollView/ScrollViewStickyHeader.js

+1
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ class ScrollViewStickyHeader extends React.Component<Props, State> {
6666
_debounceTimeout: number = Platform.OS === 'android' ? 15 : 64;
6767

6868
setNextHeaderY(y: number) {
69+
this._shouldRecreateTranslateY = true;
6970
this.setState({nextHeaderLayoutY: y});
7071
}
7172

0 commit comments

Comments
 (0)