react-native-bottom-sheet icon indicating copy to clipboard operation
react-native-bottom-sheet copied to clipboard

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

Open absolon2 opened this issue 4 years ago • 14 comments
trafficstars

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] 

absolon2 avatar Oct 12 '21 12:10 absolon2

this related #632 which i am working on a fix that hopefully will land this week 👍

gorhom avatar Oct 18 '21 20:10 gorhom

@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

tr3v3r avatar Oct 22 '21 18:10 tr3v3r

this related #632 which i am working on a fix that hopefully will land this week 👍

Hi Gorhom, is it fixed ?

siddharth-kt avatar Oct 30 '21 07:10 siddharth-kt

+1

yev-yev-yev avatar Nov 26 '21 16:11 yev-yev-yev

+1

tomgreco avatar Dec 07 '21 20:12 tomgreco

+1

itolegmysin avatar Feb 02 '22 14:02 itolegmysin

+1

guidodipaolo avatar Feb 09 '22 13:02 guidodipaolo

+1

bombillazo avatar Aug 22 '22 09:08 bombillazo

+1

jack-smith-adigium avatar Dec 21 '22 13:12 jack-smith-adigium

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

KiroMalakHabib avatar Dec 21 '22 13:12 KiroMalakHabib

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

Thanks bro it works with me.

jack-smith-adigium avatar Dec 21 '22 13:12 jack-smith-adigium

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

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

Abiodun-code avatar Jan 15 '24 05:01 Abiodun-code