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

[v4] | BottomSheet not showing when canceling native permissions

Open martinj-jaime opened this issue 1 year ago • 1 comments

Bug

Video: https://github.com/gorhom/react-native-bottom-sheet/assets/35360048/cf5f59c7-a4ae-4ddc-8987-d350d1bb3c4f

https://github.com/gorhom/react-native-bottom-sheet/assets/35360048/ad729fad-3098-41b7-920d-8b87b5b31bc7

The error is that when you cancel the permissions of Location.requestForegroundPermissionsAsync() before the bottom sheet is displayed for the first time, it is not displayed. The problem is that once it fails it is never reset again no matter how many times you re-enter the screen. As shown in the video, it took me a few tries on my Android Samung Galaxy A10.

Environment info

"expo-location": "~16.1.0", "expo-status-bar": "~1.6.0", "@gorhom/bottom-sheet": "^4.6.1", "react-native-screens": "~3.22.0", "react-native-reanimated": "~3.3.0", "@react-navigation/native": "^6.1.14", "react-native-gesture-handler": "~2.12.0", "@react-navigation/native-stack": "^6.9.22", "react-native-safe-area-context": "4.6.3"

Tested on Android Samsung A10

Steps To Reproduce

  1. Press button to navigate test screen
  2. Cancel permissions quickly
  3. Exit screen and repeat until failure, the list is to make performance slower and increase the possibility of failure

Reproducible sample code

https://snack.expo.dev/@martinjaime/bottom-sheet-v4-reproducible-issue-template

martinj-jaime avatar Apr 09 '24 12:04 martinj-jaime

@martinj-jaime Because the UI thread is stopped when the permission modal is displayed. You should wait until the gorhom's modal is shown and request permission.

exzos28 avatar Apr 17 '24 10:04 exzos28

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.

github-actions[bot] avatar May 18 '24 09:05 github-actions[bot]

stale

zereight avatar May 22 '24 14:05 zereight

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.

github-actions[bot] avatar Jun 22 '24 09:06 github-actions[bot]

This issue was closed because it has been stalled for 5 days with no activity.

github-actions[bot] avatar Jun 27 '24 09:06 github-actions[bot]