Skip to content

Commit

Permalink
fix: sticky header transform style should be applied to direct parent…
Browse files Browse the repository at this point in the history
… of rendered row
  • Loading branch information
mtourj committed Jan 24, 2025
1 parent e536489 commit febb588
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions src/FlashList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down Expand Up @@ -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}
/>
);
};

Expand Down

0 comments on commit febb588

Please sign in to comment.