AdamLee321 / react-native-sortable-dynamic

react-native-sortable-dynamic is a highly customizable, drag-and-drop library for creating sortable grid and list layouts in React Native.
MIT License
0 stars 0 forks source link

Height of element #4

Open RouberR opened 2 hours ago

RouberR commented 2 hours ago

Hi, useful library, but tell me, can I change the height of an element?

AdamLee321 commented 2 hours ago

Hi, could you give me a specific use case?

RouberR commented 1 hour ago

@AdamLee321 I want to make an element vertical and horizontal. For example, make 3 separate lists with different elements

SQUARE: { width: 171, height: 171, }, HORIZONTAL: { width: 358, height: 171, }, VERTICAL: { width: 171, height: 372, },

{!!widgets.filter(i => i.position === 'SQUARE').length && ( <SortableView config={{ MARGIN: 10, COL: 2 }} data={widgets.filter(i => i.position === 'SQUARE')} editing={true} onDragEnd={positions => console.log(positions)} renderItem={renderWidget} itemStyle={{height:171}} /> )}

{!!widgets.filter(i => i.position === 'VERTICAL').length && ( <SortableView config={{ COL: 2 }} data={widgets.filter(i => i.position === 'VERTICAL')} editing={true} onDragEnd={positions => console.log(positions)} renderItem={renderWidget} itemStyle={{height:372}} /> )}

image

image

RouberR commented 1 hour ago

@AdamLee321 I wanted to combine square, vertical and horizontal elements into one block and move them between each other. But I couldn't make it work properly. I started looking for libraries, react-native-drag-sort works very badly on android. So I want to achieve this result at least by dividing the elements into blocks with different element sizes ))