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] | BottomSheet not showing when canceling native permissions #1791

Open
martinj-jaime opened this issue Apr 9, 2024 · 3 comments
Open
Labels
bug Something isn't working

Comments

@martinj-jaime
Copy link

Bug

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

mobizen_20240408_124415.mp4

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 martinj-jaime added the bug Something isn't working label Apr 9, 2024
@exzos28
Copy link

exzos28 commented Apr 17, 2024

@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.

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.

@zereight
Copy link

stale

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