Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: inverted option causing sticky headers, ListEmptyComponent to appear inverted, and causing scroll direction to be inverted on web #1487

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
fix: sticky header transform style should be applied to direct parent…
… of rendered row
  • Loading branch information
mtourj committed Jan 24, 2025
commit febb5882ad9c14e8534b5d6d2b45343210a10925
34 changes: 18 additions & 16 deletions src/FlashList.tsx
Original file line number Diff line number Diff line change
@@ -671,7 +671,16 @@ class FlashList<T> extends React.PureComponent<
};

private rowRendererSticky = (index: number) => {
return this.rowRendererWithIndex(index, RenderTargetOptions.StickyHeader);
return (
<View
style={{
flexDirection: this.props.horizontal ? "row" : "column",
...this.getTransform(),
}}
>
{this.rowRendererWithIndex(index, RenderTargetOptions.StickyHeader)}
</View>
);
};

private rowRendererWithIndex = (index: number, target: RenderTarget) => {
@@ -727,21 +736,14 @@ class FlashList<T> extends React.PureComponent<
___: any
) => {
return (
<View
style={{
flexDirection: this.props.horizontal ? "row" : "column",
...this.getTransform(),
}}
>
<PureComponentWrapper
ref={this.stickyContentRef}
enabled={this.isStickyEnabled}
// We're passing rowData to ensure that sticky headers are updated when data changes
rowData={rowData}
arg={index}
renderer={this.rowRendererSticky}
/>
</View>
<PureComponentWrapper
ref={this.stickyContentRef}
enabled={this.isStickyEnabled}
// We're passing rowData to ensure that sticky headers are updated when data changes
rowData={rowData}
arg={index}
renderer={this.rowRendererSticky}
/>
);
};

Loading
Oops, something went wrong.