SHISME / react-native-draggable-grid

A draggable and sortable grid of react-native
308 stars 96 forks source link

Not being able to drag inside the scrollView #55

Open Ruzen1 opened 3 years ago

Ruzen1 commented 3 years ago

Hey @SHISME

Hey , How are you doing?

I am here to ask for a big help.

I am having a problem while dragging. The library works perfectly fine but when the items start increasing , the dragging stops working. I think its due to scroll view. When I pass [ contentContainerStyle={{flex: 1}} ] to the Scroll View, the dragging works fine, but the scrolling doesnt work anymore. When I remove it, the scrolling works but the dragging doesnt.

It would be really ver great help of you if you could give me some guidance, please.

Thank you

<ScrollView
           style={{
          minHeight: Dimensions.get("window").height * 0.85,
            backgroundColor: taknalColors.activeColor
}}>
                    <View
                      style={{
                        minHeight: Dimensions.get("window").height * 0.85,
                        backgroundColor: taknalColors.activeColor
                      }}>
                      <DraggableGrid
                        itemHeight={Dimensions.get("window").height * 0.24}
                        numColumns={3}
                        renderItem={this.render_item}

                       // Rest of the important codes
                      />
                    </View>
 </ScrollView>
SHISME commented 3 years ago

Maybe you should set the children's view height difference with ScrollView

Ruzen1 commented 3 years ago

@SHISME Thank you for the reply. Can you please give me an example?

SHISME commented 3 years ago

@SHISME Thank you for the reply. Can you please give me an example?

may like this


<ScrollView
           style={{
          minHeight: Dimensions.get("window").height * 0.85,
            backgroundColor: taknalColors.activeColor
}}>
                    <View>
                      <DraggableGrid
                        itemHeight={Dimensions.get("window").height * 0.24}
                        numColumns={3}
                        renderItem={this.render_item}

                       // Rest of the important codes
                      />
                    </View>
 </ScrollView>
arunvignesh-foodhub commented 1 year ago

The above code isn't working