onViewableItemsChanged not getting called
Description
Am currently using the AgendaList component to render some reservation items sectioned by day and I would like to know the current items visible on the screen.
Expected Behavior
onViewableItemsChanged is supposed to be called as soon as the items on the viewable space has changed.
Observed Behavior
onViewableItemsChanged is not getting called no matter where I scroll. The props passed:
viewabilityConfig={{ viewAreaCoveragePercentThreshold: 80, itemVisiblePercentThreshold: 80, }} onViewableItemsChanged={({ viewableItems, changed }) => { Alert.alert('test!'); console.log('items change', viewableItems); console.log('Changed in this iteration', changed); }}
Environment
[email protected] [email protected]
- Device/emulator/simulator & OS version: Simulator: IOS 15; Android API 29
simplified code:
<CalendarProvider onDateChanged={this.onDateChanged} onMonthChange={this.onMonthChange} > <ExpandableCalendar // props /> )} <AgendaList sections={ITEMS} renderItem={this.renderItem} viewabilityConfig={{ viewAreaCoveragePercentThreshold: 80, itemVisiblePercentThreshold: 80, }} onViewableItemsChanged={({ viewableItems, changed }) => { Alert.alert('test!'); console.log('items change', viewableItems); console.log('Changed in this iteration', changed); }} /> </CalendarProvider>
from the docs I can see this agendaList component extends sectionList. are some props just not actively supported? Im also getting no behavior from getItemCount prop.
Update: I was able to note why this issue was occurring. the AgendaList makes use of sectionList's "onViewableItemsChanged" which pretty much was overriding the users callback. Perhaps add support to call the user defined "onViewableItemsChanged" as well as agendaLists
@BertoGz Please follow PR #1889
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.