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

<Select /> renders below modals on iOS #4153

Open
FezVrasta opened this issue Oct 2, 2021 · 30 comments
Open

<Select /> renders below modals on iOS #4153

FezVrasta opened this issue Oct 2, 2021 · 30 comments
Labels
v3 V3

Comments

@FezVrasta
Copy link

FezVrasta commented Oct 2, 2021

Before reporting this bug, please...

  1. Check the latest documentation: https://docs.nativebase.io/
  2. Check for existing open/closed issues for a possible duplicate before creating a new issue: https://github.com/GeekyAnts/NativeBase/issues
  3. Use the latest NativeBase release: https://github.com/GeekyAnts/NativeBase/releases
  4. Check examples from NativeBase KitchenSink https://github.com/GeekyAnts/NativeBase-KitchenSink
  5. For discussion purpose make use of NativeBase discord: https://discord.gg/TSgCw2UPmb

Describe the bug

If I click to open a rendered inside an iOS modal, the select is rendered below the modal. To Reproduce Steps to reproduce the behaviour: As description. Expected behaviour The Select should float above the modal. CodeSandBox/Snack link Screenshots Platform NativeBase version [e.g. 3.0.1] latest Device: [e.g. iPhone6] any OS: [e.g. iOS8.1] iOS 15 Browser [e.g. stock browser, safari] N/A Browser version [e.g. 22] N/A React Native version [e.g. sdk-42] Expo sdk version [e.g. 41] 42 node [e.g. 14.16.1] 14.17.4 yarn or npm [e.g. 6.1] Yarn 3.0.2 Additional information Add any other context about the problem here. Is the bug present in both iOS and Android or in any one of them? If you want your issue to be looked at quicker, please attach a snack reproducible with your issue. Makes it easier for us!

@FezVrasta FezVrasta added the v3 V3 label Oct 2, 2021
@intergalacticspacehighway
Copy link
Contributor

@FezVrasta are you using Modal component from NativeBase? React Native's built in modal always appears on top of any View. Let us know if the Modal from NativeBase works as expected.

@FezVrasta
Copy link
Author

I'm using the one from React navigation, I suppose it's the Native one. I'll try with yours

@intergalacticspacehighway
Copy link
Contributor

Okay sure, with React Navigation can you try putting the NativeBaseProvider above the NavigationContainer?

@cruzlutor
Copy link

cruzlutor commented Oct 17, 2021

Hey everyone, I have the same issue, even after move NavigationContainer into NativeBaseProvider

<NativeBaseProvider>
  <NavigationContainer>
    ...
  </NavigationContainer>
</NativeBaseProvider>

But I got the same result FezVrasta mentioned

@intergalacticspacehighway
Copy link
Contributor

@cruzlutor are you using native StackNavigator?

@cruzlutor
Copy link

cruzlutor commented Oct 18, 2021

Yes, I'm using NativeStackNavigator instead StackNavigator, However, after the switch to StackNavigator it made the trick.
Do you know why StackNavigator works and NativeStackNavigator doesn't?

@intergalacticspacehighway
Copy link
Contributor

The Modal components in NativeBase uses a JavaScript portal implementation and it doesn't render on top of the Native Stack Navigator screens. We're actively looking into this issue. I'll update once we come up with a solution.
Current hacky solution to make it work would be to wrap each screen with a NativeBaseProvider.

@rananajam1
Copy link

Any updates on this? Or any workarounds I can try?

@OneHatRepo
Copy link

I'm running into this too.

@eneax
Copy link

eneax commented Nov 16, 2021

I had the same issue while using Select and Popover (NativeBase v3.2.2).
The only solution that worked for me was to replace @react-navigation/native-stack with @react-navigation/stack.

@stale
Copy link

stale bot commented Feb 2, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Feb 2, 2022
@FezVrasta
Copy link
Author

Don't close this issue. This is an automatic message by Fresh - a bot against stale bots.

@stale stale bot removed the stale label Feb 3, 2022
@mchambaud
Copy link

I have the same issue, using 3.3.5

@surajahmed
Copy link
Collaborator

The issue occurs due to multiple overlay components. We're working on it. Hope to fix this in the coming release.

@mcatal
Copy link

mcatal commented Feb 22, 2022

I have the same issue, using 3.3.7

@sjonchhe
Copy link

i am having the same issue with 3.2.2

@mcatal
Copy link

mcatal commented Apr 13, 2022

still same 3.4.1

@surajahmed
Copy link
Collaborator

We're working on this. Hope to fix this in the coming release. Thanks for your patience.

@uschtwill
Copy link

uschtwill commented Jun 18, 2022

Would be helpful to mention this restriction in the docs for the time being. Would have saved me an hour or so. Probably the same for others.

@asurion-ashutosh
Copy link

ANy update on this yet i am still facing same issue>

@GunturThunder
Copy link

any update ??

@matheussss1
Copy link

Any update? same issue

@surajahmed
Copy link
Collaborator

We've been working on some workaround. This issue is coming from our internal Overlay component. We've to change our component render pattern to solve this issue. This may take some time.

Thanks for your patience.

@cguagenti
Copy link

Thanks @surajahmed.

Same here. any suggestion or workaround for the time being?

@olamigokayphils
Copy link

FIX: upgrade to version 3.4.6 (or higher)

Replace import { Modal } from "react-native";
with import { Modal } from 'native-base';

Select should now render above modal on iOS. https://docs.nativebase.io/select

@byberkan
Copy link

byberkan commented Nov 7, 2022

this is still happening and I am on 3.4.20
Is any one else still having this? or can you guys confirm at least if this is working for you now? I have spent days on this and planning to completely take off the nativebase unfortunately.

@rileyy29
Copy link

rileyy29 commented Nov 7, 2022

@byberkan I managed to get it working when using the "presentation" prop for Stack Navigator Screen Options but couldn't get it working for general purposes (it seemed very on-off and sometimes it would work).
In the end, we changed the design to get around this.

Edit: You need to be on 3.4.6

@mcanikhilprajapati
Copy link

FIX: upgrade to version 3.4.6 (or higher)

Replace import { Modal } from "react-native"; with import { Modal } from 'native-base';

Select should now render above modal on iOS. https://docs.nativebase.io/select

this is working perfectly

Thanks @olamigokayphils

@habaieba
Copy link

Hi, same probleme here. When using createNativeStackNavigator (react-navigation ) and having one of my screen with presentation option prop set to "modal", the select displays behind the screen modal.

@eblancperso
Copy link

Hi, same probleme here. When using createNativeStackNavigator (react-navigation ) and having one of my screen with presentation option prop set to "modal", the select displays behind the screen modal.

Does this solve your issue? It solved mine which was kind of the same as yours: #4864 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v3 V3
Projects
None yet
Development

No branches or pull requests