-
Notifications
You must be signed in to change notification settings - Fork 226
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
On android, action sheets will open behind modals, not in front of them. #164
Comments
Thanks for reporting this -- how are you triggering modals in your app? Can you provide an example with an Expo Snack? |
No problem! I'm just using a simple built in useState hook (in component.js). Here is a quick demo I threw together in snack, as you can see the action sheet opens in front of the modal on IOS but behind the modal on Android. Feel free to let me know if I'm doing anything weird |
@timsonater I'm not sure if this is possible.. given that the Android action sheet is just an absolutely positioned view. I wonder if it would be possible to use a Modal for it instead of a view. I'll play with it and see what happens. |
A SO with a similar need.. https://stackoverflow.com/questions/39766350/bring-view-on-top-of-modal-using-zindex-style-with-react-native. |
I'm having exactly the same issue on Android. Working good on iOS. I forked the snack, to create the same version but using the @bradbumbalough I'm reading in your link that ReactNative added EDIT: I just saw that I will be impossible to show it because the Modal is always on top of everything. |
@BrodaNoel thanks for the feedback. The reason it works in iOS is because it's not a custom component, but the actual native APIs being invoked. So, if Android had an equivalent API that we could use it would probably work too since they would handle it being rendered on top. The only thing I'm thinking could work is to render the action sheet in a modal instead of an absolutely positioned view. |
@bradbumbalough well... That makes totally sense. It should work, yes. The action-sheet works naturally as a Modal window, so, it would even make sense semantically. Some months ago, React Native had some problems when 2 modals were opened at the same time, but right now it is fixed, so, we should not have any problems now while opening a second modal (the action-sheet) when a first modal is opened. The problem was this: |
@bradbumbalough my project is blocked by this issue, so, if you don't have the time to check it out, please let me know and I can try to send a PR. Just send me some clues and I'll do my best to fix it (anyways, seems like the fix should be something simple around here) |
Stumbled into this as well, it would be nice to get the ActionSheet in front of the Modal on Android too. It also seems like the Expo developer menu opens behind any Modals. This however happens on both Android and iOS. |
@positimo yeah, agree, I also see the Expo menu behind the modal, on iOS |
@bradbumbalough PR created #169 |
🎉 This issue is included in version 3.7.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
It didnt't worked by having a global After lot of trial and error, had to:
After that, worked ok. |
Added |
What worked for me was using ActionSheetProvider in the modal. Like this:
|
JFYI: for me |
When opening action sheets within modals on android devices, the modal covers the action sheet and it cannot be accessed unless the modal is closed. Anyone else having this issue?
The text was updated successfully, but these errors were encountered: