gorhom / react-native-bottom-sheet

A performant interactive bottom sheet with fully configurable options πŸš€
https://ui.gorhom.dev/components/bottom-sheet
MIT License
6.66k stars 740 forks source link

[v4] Bottom sheet close method does nothing after sheet is interrupted while closing #695

Open absolon2 opened 2 years ago

absolon2 commented 2 years ago

Bug

Hi, I have a problem with bottom sheet's close method. When you try to close the bottom sheet with a button and then you interrupt it with your finger. It looks like it's stuck in some state and close method does absolutely nothing after that. However I can still close the bottom sheet by swiping it down. Or fix "the state" by resizing it manually a bit but that's not a solution for me as I want to close the bottom sheet with a button. Look at the provided video and snack example. I am using Expo SDK 42.

Environment info

Library Version
@gorhom/bottom-sheet 4.1.1
react-native 0.63.53
react-native-reanimated 2.2.2
react-native-gesture-handler 1.10.3

Steps To Reproduce

  1. Open the bottom sheet using the expand() method or use animateOnMount={true}
  2. Press the close button which calls close()
  3. Bottom sheet starts it's closing animation
  4. While the bottom sheet closing animation is in progress, interrupt it with your finger and hold it in the position
  5. Lift your finger without swiping
  6. Press the close button again multiple times
  7. Nothing happens

Describe what you expected to happen:

  1. I expect the bottom sheet to close when the close button is pressed again after interrupting it.

Reproducible sample code

https://snack.expo.dev/fUYBOczk2

Video

https://user-images.githubusercontent.com/84575256/136959007-a4b794f0-7b64-4679-ae4b-1893dc5afa22.mp4

Logs

Maybe some logs will help you

[BottomSheet::handleClose] 
[BottomSheet::animateToPosition] velocity:0 position:725 currentPosition:525
[BottomSheet::handleOnAnimate] toIndex:-1 fromIndex:0
[BottomSheet::handleClose] 
[BottomSheet::handleClose] 
[BottomSheet::handleClose] 
[BottomSheet::handleClose] 
gorhom commented 2 years ago

this related #632 which i am working on a fix that hopefully will land this week πŸ‘

tr3v3r commented 2 years ago

@gorhom If it helps you I stared to face with interaction issue right after updating react native and reanimated to the latest versions( two days ago ). Before this everything worked perfectly

6EF69E29-EF9E-4F19-915B-CC8974F598C6

siddharth-kt commented 2 years ago

this related #632 which i am working on a fix that hopefully will land this week πŸ‘

Hi Gorhom, is it fixed ?

yev-yev-yev commented 2 years ago

+1

tomgreco commented 2 years ago

+1

itolegmysin commented 2 years ago

+1

guidodipaolo commented 2 years ago

+1

bombillazo commented 2 years ago

+1

jack-smith-adigium commented 1 year ago

+1

KiroMalakHabib commented 1 year ago

It is closed you can use forceClose() instead of close() sheetRef.current()?.forceClose()

jack-smith-adigium commented 1 year ago

It is closed you can use forceClose() instead of close() sheetRef.current()?.forceClose()

Thanks bro it works with me.

Abiodun-code commented 8 months ago

It is closed you can use forceClose() instead of close() sheetRef.current()?.forceClose()

Thanks bro it works with me. It's not working

f-bog commented 3 months ago

Still having this issue. Am i missing something? Using BottomSheetModal and the forceClose method.. Difference being I'm using a forwarded ref.

f-bog commented 2 months ago

Still having this issue. Am i missing something? Using BottomSheetModal and the forceClose method.. Difference being I'm using a forwarded ref.

My bad, mistake. I had my forceClose in the pressIn prop without realising.. Don't do that πŸ˜