react-native-sortable-list
react-native-sortable-list copied to clipboard
Empty space remains after an item has been removed from list
After I remove an object from the data and call setState again, the space occupied by the element remains.
After a row has been deleted, something occupies its space. Here is a picture of that https://ibb.co/jnZckF
I can't reproduce your bug. Could you make changes in the Horizontal example to reproduce it?
@gitim Im not able to delete an item from the list. Can you put ur data on state and try deleting an object from state? This should re render the list.
The sortable list component shallow compares the data props to check for updates, maybe you just mutated the data props or the order props. Try creating a new object for data prop without the element you wanted to remove.
@srameshr https://github.com/gitim/react-native-sortable-list/blob/example/examples/Horizontal/index.js
I ran into this issue as well with a horizontal SortableList. I was able to get around it by explicitly setting the width of innerContainerStyle
innerContainerStyle={ { width: ITEM_WIDTH * this.state.data.length } }