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

A lot of space under listview when try to insert element on the last position

Open EJohnF opened this issue 7 years ago • 2 comments

two problems:

  1. a lot of space under list view
  2. very fast scrolling to the bottom (almost immediately)

Code:

<SortableListView style={{ marginBottom: 44 }} data={this.state.items} order={this.state.order} disableAnimatedScrolling bounces={false} // tryed to set it to true onRowMoved={e => replacePositions(e.from, e.to)} renderRow={row => <JobPreviewItem data={row} />} renderSeparator={() => <View style={{ height: 8 }} />} renderFooter={this.renderAddPicture} />

video with a problem: https://drive.google.com/file/d/1OsJvX-mlvUMVeS_g8X1c2kGL0KiBrR7l/view?usp=sharing

EJohnF avatar Nov 29 '17 22:11 EJohnF

I've found how to solve a problem with space under listview. But it's definitely very bad way (just a hack):

need to change here (line 244)

const MAX_HEIGHT = Math.max(
          0,
          this.scrollContainerHeight - this.listLayout.height + itemHeight
        )

to this.scrollContainerHeight - this.listLayout.height + itemHeight + 300

and here (line 303)

handleContentSizeChange = (width, height) => {
    this.scrollContainerHeight = height
  }

to this.scrollContainerHeight = height - 300

EJohnF avatar Nov 29 '17 22:11 EJohnF

Thanks for reporting, I'm aware of that too

nihgwu avatar Dec 07 '17 11:12 nihgwu