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

Resize when hiding items?

Open GollyJer opened this issue 5 years ago • 4 comments
trafficstars

Hi! This is a question and not a feature request. Also posted on StackOverflow. Feel free to close this if you feel that's a better place to answer.

I'm using the isActive property to set css display: none on some rows.
The goal was to make drag/drop by top level category easier.

However, the rows are still taking up space. I'm hoping to (in this example) get Sleep and Energy to be right on top of each other.

Is there something simple I'm missing to get the list to resize when the rows are hidden?

Thanks!

GollyJer avatar Jun 28 '20 00:06 GollyJer

P.S. - I also made a react-native-draggable-flatlist tag on stackoverflow and tagged all the questions I could find properly.

GollyJer avatar Jun 28 '20 00:06 GollyJer

Check this out https://github.com/thomasrovayaz/react-native-draggable-dynamic-flatlist

jacquesdev avatar Jul 03 '20 20:07 jacquesdev

Interesting. What would happen if you grabbed the lower item? both lists would collapse, but the item would still be under your finger, so there'd still be a big gap, no?

computerjazz avatar Jul 08 '20 23:07 computerjazz

Yeah. We started only collapsing lists below the selected item for that exact reason. In the end we made it a two step process. Tap the header to collapse all lists, then you're able to drag drop.

To get the list collapsing our workaround was to add react-native-collapsible around the lists.

GollyJer avatar Jul 09 '20 00:07 GollyJer