react-native-section-alphabet-list icon indicating copy to clipboard operation
react-native-section-alphabet-list copied to clipboard

how do you make the section header sticky?

Open chj-damon opened this issue 3 years ago • 3 comments

I read your code but I didn't figure out what you've done to make it work.

chj-damon avatar Nov 29 '21 12:11 chj-damon

Probably use stickySectionHeadersEnabled, check the docs for more: https://reactnative.dev/docs/sectionlist#rendersectionheader

razinj avatar Aug 10 '22 00:08 razinj

Probably use stickySectionHeadersEnabled, check the docs for more: https://reactnative.dev/docs/sectionlist#rendersectionheader

Yes, stickySectionHeadersEnabled works for me.

<AlphabetList
  data={data}
  stickySectionHeadersEnabled
  indexLetterStyle={styles.indexLetterStyle}
  letterListContainerStyle={styles.letterListContainerStyle}
  indexLetterContainerStyle={styles.indexLetterContainerStyle}
  renderCustomItem={(item) => (
    <View style={styles.listItemContainer}>
      <Text style={styles.listItemLabel}>{item.value}</Text>
    </View>
  )}
  renderCustomSectionHeader={(section) => (
    <View style={styles.sectionHeaderContainer}>
      <Text style={styles.sectionHeaderLabel}>{section.title}</Text>
    </View>
  )}
/>

Gaohaoyang avatar Sep 25 '23 18:09 Gaohaoyang

I've searched the codebase, I didn't find stickySectionHeadersEnabled appears in it. that's weird.

chj-damon avatar Sep 26 '23 02:09 chj-damon