Conversation
2e4a922 to
b52a523
Compare
| {renderEmpty} | ||
| {renderFooter} | ||
| </CompatScrollView> | ||
| {stickyHeaderIndices ? renderStickyHeaderBackground : null} |
There was a problem hiding this comment.
Let's make it something generic. Atleast the name
| {renderHeader} | ||
| {!isHorizontalRTL && viewToMeasureBoundedSize} | ||
| {/* Spacer for sticky header offset */} | ||
| {stickyHeaderIndices && stickyHeaderOffset > 0 && ( |
There was a problem hiding this comment.
Let's handle this using contentContainerStyle padding
b52a523 to
1fb193a
Compare
1fb193a to
6adb670
Compare
| outputRange: [0, -currentStickyHeight], | ||
| extrapolate: "clamp", | ||
| }), | ||
| opacity: stickyHeaderOffset |
There was a problem hiding this comment.
Let's put an explicit check > 0
| getY: (index: number) => number | ||
| ): number { | ||
| // Special case: when at the top of the list, show the first sticky header if it's near the top | ||
| if (adjustedValue <= 0 && sortedIndices.length > 0) { |
There was a problem hiding this comment.
Can you explain this a bit more?
| style={{ | ||
| position: "absolute", | ||
| inset: 0, | ||
| zIndex: 1, |
There was a problem hiding this comment.
The zIndex isn't needed I think
| /** Additional data to trigger re-renders */ | ||
| extraData: FlashListProps<TItem>["extraData"]; | ||
| /** Sticky header change handler */ | ||
| onChangeStickyIndex?: (index: number) => void; |
There was a problem hiding this comment.
This can be a useful prop on FlashList too. onChangeStickyIndex: (current, previous) => void. Let's add it.
6adb670 to
98e5177
Compare
| } | ||
| } | ||
|
|
||
| console.log("RESULT", result); |
| {renderEmpty} | ||
| {renderFooter} | ||
| </CompatScrollView> | ||
| {stickyHeaderIndices ? renderStickyHeaderBackdrop : null} |
There was a problem hiding this comment.
Let's check length also, in case it's empty
| <CompatView | ||
| style={{ | ||
| height: horizontal ? undefined : 0, | ||
| height: horizontal ? undefined : 0 + stickyHeaderOffset, |
There was a problem hiding this comment.
I'm not sure about this. It can throw off compute. I think we discussed doing this will padding instead. You can also try applying it as marginTop here.
3585f42 to
76355de
Compare
… offset spacer, background layer, and header hiding; update docs/changelog and add StickyHeader example in RN fixture
76355de to
3da7a69
Compare
|
@alexrass Is there a way to get the backdropComponent to appear under the scrollbar? It doesn't really work for adding a background color or blur because it also affects the scrollbar |
|
I was just looking for this, thank you! Legend ❤️ |
|
can someone share videos of how it is visually looking |
What problem does this PR solve?
Sticky headers lacked key capabilities needed in real apps:
This PR adds configuration and APIs to control sticky header behavior and appearance, while keeping defaults backward compatible.
Changes
Test Plan