react-native-sortable-list icon indicating copy to clipboard operation
react-native-sortable-list copied to clipboard

Empty space remains after an item has been removed from list

Open srameshr opened this issue 8 years ago • 5 comments

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

srameshr avatar Jul 14 '17 21:07 srameshr

I can't reproduce your bug. Could you make changes in the Horizontal example to reproduce it?

gitim avatar Jul 17 '17 15:07 gitim

@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.

srameshr avatar Jul 17 '17 17:07 srameshr

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.

tnagorra avatar Aug 10 '17 13:08 tnagorra

@srameshr https://github.com/gitim/react-native-sortable-list/blob/example/examples/Horizontal/index.js

gitim avatar Aug 14 '17 12:08 gitim

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 } }

patmay avatar Oct 23 '21 20:10 patmay