SHISME / react-native-draggable-grid

A draggable and sortable grid of react-native
314 stars 95 forks source link

disabledDrag is no working #49

Closed jhon-hst closed 3 years ago

jhon-hst commented 3 years ago

disabledDrag is no working or please tell me what my mistake I need some specific boxes not to be draggable

    `const render_item = ({ name, key }) => {
           return (
                <View
                    style={[ styles.containerImage ]}
                    key={key}
                    disabledDrag={true}
                    disabledReSorted={true}
                >
                    <Image source={Images['photo1']} style={[ styles.image ]} />
                </View>
          )
    }

    return (
        <DraggableGrid
              numColumns={2}
              renderItem={render_item}
              data={images}
              itemHeight={120}
              onDragRelease={(data) => {
                    setImages(data)
              }}
              style={{ maxHeight: 350 }}
        />
    )`
SHISME commented 3 years ago

you need set disabledDrag in your data, not in children's porps, may like this


images = [
{
  disabledDrag: true,
  disabledReSorted: true

}
]
jhon-hst commented 3 years ago

Thank you very much, I solved the problem