react-native-draggable-grid
react-native-draggable-grid copied to clipboard
FlatList causes corruption after item is dragged
After dragging the item, FlatList onViewableItemsChanged no longer triggers.
[email protected] [email protected]
I noticed that when it happens like this there is this bug:
<ScrollView scrollEnabled={this.state.scrollEnabled}>
<DraggableGrid
numColumns={3}
renderItem={this.render_item}
data={this.state.data}
onDragStart={() => {
this.setState({scrollEnabled: false})
}}
onDragRelease={(data) => {
this.setState({data, scrollEnabled: true});
}}
/>
</ScrollView>
When I did it as mentioned here https://github.com/SHISME/react-native-draggable-grid/issues/84#issuecomment-1751964058 the problem was solved. I think updating it as state causes such a problem.