lodev09 / react-native-true-sheet

The true native bottom sheet experience 💩
https://sheet.lodev09.com
MIT License
703 stars 14 forks source link

Header component when using ScrollableViews #100

Open ljukas opened 3 weeks ago

ljukas commented 3 weeks ago

When using Scrollable views such as ScrollView and Flatlist I am having issues having any other component above, like a header.

Variants

  1. Using ListHeaderComponent and stickyHeaderIndices.

    • On iOS the scrollBounce drags the header down. This is not wanted
  2. Putting the Header as a regular component inside the Sheet and the list after.

    • Randomly puts the list over the header component and makes the list cover the entire sheet (this is the buggy part)
  3. Absolute position the header above the List

    • Workable solution but requires a lot of special code to position things and the list needs to be inset a bit etc.

Best solution would be if nr 2 works since this is the regular approach when using any other view or sheet, or react native sheet modal etc.

lodev09 commented 2 weeks ago

When dealing with Scrollviews, the sheet has to handle it internally so the best solution for now is 3 :/ e.g. float the header above and add padding to the scrollview.

I can't add support for no. 2 since it would require the same special-internal code and I wanted it to be less opinionated.