react-native-draggable-grid icon indicating copy to clipboard operation
react-native-draggable-grid copied to clipboard

FlatList causes corruption after item is dragged

Open mronline opened this issue 2 years ago • 1 comments

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>

mronline avatar Oct 18 '23 08:10 mronline

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.

mronline avatar Oct 18 '23 10:10 mronline