mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
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 (https://github.com/facebook/react-native/commit/fa5d3fb6b8c561b749f3e86316d06543a52dcc1c) 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
This commit is contained in:
committed by
Lorenzo Sciandra
parent
d894163662
commit
eaed48fc7d
@@ -64,6 +64,7 @@ class ScrollViewStickyHeader extends React.Component<Props, State> {
|
||||
_debounceTimeout: number = Platform.OS === 'android' ? 15 : 64;
|
||||
|
||||
setNextHeaderY(y: number) {
|
||||
this._shouldRecreateTranslateY = true;
|
||||
this.setState({nextHeaderLayoutY: y});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user