ollija / react-native-sortable-grid

Drag-drop-sortable grid view for react native
MIT License
439 stars 171 forks source link

Allow children to mark themselves as inactive #29

Closed gfontenot closed 6 years ago

gfontenot commented 6 years ago

It's occasionally useful to be able to have cells that don't respond to user interactions, like if you're trying to pad out a grid with "empty" cells. In that case, we should let consuming code mark child nodes as inactive, which will disable the touch handling for the block.

This is an alternate implementation to the one proposed in #23. I believe they both try to solve the same problem, but in different ways.

eduardojunio commented 6 years ago

@gfontenot although you couldn't move the item by dragging it, the other items movement will affect its order. So I made a PR (#42) that adds a flag called fixed to the children's components, all children with this flag won't be affected by other elements sorting.