Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v4] | [v2] BottomSheetFooter on top of BottomSheetFlatList items when there are a few items that don't cover entire screen #1878

Open
edisoni1995 opened this issue Jul 5, 2024 · 9 comments
Labels
bug Something isn't working

Comments

@edisoni1995
Copy link

edisoni1995 commented Jul 5, 2024

Bug

So I have a BottomSheetFlatList which has only 2 items and I am using BottomSheetFooter to show a sticky footer.

Even though I have 2 items, I see only one item and I have to scroll to see other ones while the modal doesn't even cover half of the screen so there is enough space for the modal to expand more to show the remaining items.

If I add 3 more items for example the modal expands more and all the items are shown on the screen without the need to scroll. For users, it's very difficult to think that there is another item in there and they need to scroll.

Environment info

Library Version
@gorhom/bottom-sheet 4.6.1
react-native 0.72.5
react-native-reanimated 3.5.4
react-native-gesture-handler 2.12.1

Describe what you expected to happen:

1.The footer should be shown and all the items should be visible in the screen since there is more than enough space.

Reproducible sample code

<BottomSheetModal
          enableDynamicSizing
          enablePanDownToClose
          index={0}
          handleIndicatorStyle={modalStyles.handleStyle}
          keyboardBlurBehavior="restore"
          keyboardBehavior={keyboardBehavior}
          android_keyboardInputMode="adjustPan"
          maxDynamicContentSize={DYNAMIC_CONTENT_MAX_HEIGHT}
          ref={bottomSheetModalRef}
          footerComponent={
            showFooter
              ? props => (
                <BottomSheetFooter {...props}>
                  <ModalFooter
                    primaryButtonProps={primaryButtonProps}
                    textButtonProps={textButtonProps}
                  />
                </BottomSheetFooter>
                )
              : undefined
          }
        >
          <BottomSheetFlatList
              keyboardShouldPersistTaps="always"
              keyboardDismissMode="interactive"
              {...flatListProps}
              contentContainerStyle={[
                modalStyle,
                onSearchText && modalStyles.flatListSearch,
              ]}
              scrollEnabled={scrollEnabled}
              data={data}
              ListHeaderComponent={headerComponent}
              enableFooterMarginAdjustment
            />
        </BottomSheetModal>

Screenshot from 2024-07-05 15-29-13
Screenshot from 2024-07-05 15-30-11

@edisoni1995 edisoni1995 added the bug Something isn't working label Jul 5, 2024
Copy link

github-actions bot commented Jul 5, 2024

@edisoni1995: hello! 👋

This issue is being automatically closed because it does not follow the issue template.

Copy link

github-actions bot commented Aug 5, 2024

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@edisoni1995
Copy link
Author

not stale

@sudhanshu-busy
Copy link

not stale

@kuldip-simform
Copy link

same issue for me as well.
anyone has any lead on this, can you please help me?
@edisoni1995 @sudhanshu-busy any luck from your side ? do you able to resolve this ?

@kuldip-simform
Copy link

even using v5, still not solved. OnLayout. This is log of onLayout of scrollview.
It goes to 0.
Screenshot 2024-09-16 at 3 30 07 PM

Simulator.Screen.Recording.-.iPhone.SE.3rd.generation.-.2024-09-16.at.15.31.01.mp4

@gorhom Can you please help here.

@edisoni1995
Copy link
Author

@kuldip-simform I was not able to resolve it as I didn't have much time to check on this but what I did is a condition when there are less than x items to show a different component for the flatlist footer

Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@kuldip-simform
Copy link

Definitely not stale. I am still facing this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants