rn-sliding-up-panel icon indicating copy to clipboard operation
rn-sliding-up-panel copied to clipboard

Flatlist last rows doesn't showup

Open SanchiSinghal opened this issue 5 years ago • 7 comments

I've put something like sliding-up-panel with scrollview inside the sliding-up-panel there's a view and after that there's a scrollview inside that view and I've used flatlist inside the scrollview but I don't why some of the doesn't render. When the slidin-up-panel is half opened intially some 3 and half row doesn't get displayed and when I switch to full height last 1 row or 1 and half row doesn't get displayed. P.S And when I provide a paddingBottom it gives me certain part of records. Please can anyone help me out with this ?

SanchiSinghal avatar Jul 12 '18 13:07 SanchiSinghal

I'm experiencing a similar. I'm using the rn-sliding-up-panel to show a list view (FlatList), and the panel is visible by default (covering half the screen) but can be dragged up to cover the full screen. The problem is, say the entire list is rendered in the "collapsed" state of the panel. If you scroll the list you won't be able to see all the items (you have drag the panel up to the "expanded" state and you will be able to see them).

I've tried tracking the state of the panel and dynamically setting padding on the list container. This works, but I've had some challenges correctly determining the state the panel is in and the appropriate padding height to set as a result. I found some workarounds but the problem was overall the performance and UX started to suffer as a result.

I'm not sure if this package can provide a specific solution for this use case, or what that would look like.

One thing I'm working on now is to just have a default behavior where scrolling to the bottom of the list expands the panel, so I don't have to set the height dynamically.

bonham000 avatar Aug 28 '18 03:08 bonham000

Guys how can we set the height of the Pannel, i have tried using the height={20} however the height still take up the entire device screen.

graig12 avatar Nov 22 '18 05:11 graig12

I just calculated the height of the available view that is occupied by the panel when fully open and pass that value as a prop to the slidingpanel component

alejandroclvi avatar Jun 24 '19 13:06 alejandroclvi

I've put something like sliding-up-panel with scrollview inside the sliding-up-panel there's a view and after that there's a scrollview inside that view and I've used flatlist inside the scrollview but I don't why some of the doesn't render. When the slidin-up-panel is half opened intially some 3 and half row doesn't get displayed and when I switch to full height last 1 row or 1 and half row doesn't get displayed. P.S And when I provide a paddingBottom it gives me certain part of records. Please can anyone help me out with this ?

Wrap the ScrollView or FlatList in another View and give height to that View. Like this

<View style={{ height: 236 }}> 
    <FlatList
         data={this.state.locations} 
         renderItem={({ item }) => <YourListItem location={item} />} 
         keyExtractor={item => item.id.toString()} 
    />
</View>

gabycasper007 avatar Jul 18 '19 08:07 gabycasper007

@gabycasper007 suggestion works for me, however I changed the height to:

height: height*0.8-14 (height of slideUpPanel - margin inside of the slideUpPanel)

mboettcher avatar Jul 23 '19 05:07 mboettcher

I had the same problem. Managed to fix it by setting SlidingUpPanel's height this way:

const draggableRange = {
    top: height - 200,
    bottom: 85,
};

and then -

 <SlidingUpPanel
     draggableRange={draggableRange}
     height={draggableRange.top}
     ...
  >

efratyo avatar Oct 28 '20 08:10 efratyo

thank you @efratyo your solution works for me too!

Darkensses avatar May 11 '21 02:05 Darkensses