react-native-safe-area-context icon indicating copy to clipboard operation
react-native-safe-area-context copied to clipboard

ios Safe Area is Not Working in the model

Open Ibrahim113502 opened this issue 3 months ago • 7 comments

Description

Description

When rendering a <SafeAreaView> inside a native React Native <Modal>, safe area insets are not applied on iOS devices (e.g., notch or home indicator areas are ignored).

The same SafeAreaView works correctly when used in the main app tree.

Expected Behavior

SafeAreaView should respect safe area insets on iOS even when rendered inside a <Modal>.

Actual Behavior

Insets are always 0 inside <Modal> on iOS. The content touches the notch and bottom safe areas.

Steps to reproduce

  1. Wrap app with <SafeAreaProvider> at the root.
  2. Create a <Modal> with a <SafeAreaView> inside.
  3. Render it on an iPhone with a notch.
  4. Observe that there’s no padding at the top or bottom.

Snack or a link to a repository

nope

Safe Area Context version

5.6.2

React Native version

0.81.5

Platforms

iOS

Build type

Debug mode

Device

iOS simulator

Device model

iphone 16 pro max

Acknowledgements

Yes

Ibrahim113502 avatar Nov 10 '25 07:11 Ibrahim113502

In case it's not clear from the description, I think OP wanted to report that SafeAreaView doesn't work inside modals (Modal, FullWindowOverlay) on iOS 26. I've run into this issue too.

SimpleCreations avatar Nov 19 '25 12:11 SimpleCreations

It's quite a major issue...

zabojad avatar Nov 27 '25 10:11 zabojad

SafeAreaView is acting inconsistently on iOS for me, it's not working roughly half the time. I’ve tried setting the edges manually and using the default values, but I’m seeing the same behavior on both the simulator and a real device. Since the old SafeAreaView from react-native is getting deprecated, any help or quick fix would be super useful !

0xEzis avatar Nov 27 '25 15:11 0xEzis

Does it work if you add a provider inside the modal, like:

<Modal>
  <SafeAreaProvider>
    <SafeAreaView>
      …
    </SafeAreaView>
  </SafeAreaProvider>
</Modal>

janicduplessis avatar Nov 27 '25 16:11 janicduplessis

@janicduplessis Adding the provider as you suggested fixes the issue for me 👏

SimpleCreations avatar Nov 28 '25 14:11 SimpleCreations

Nice, this is probably something that should be documented.

janicduplessis avatar Nov 28 '25 16:11 janicduplessis

On my side, I’m seeing issues even outside of modals.

I’m using expo-router and have SafeAreaProvider in my root _layout.tsx, but the safe area is still inconsistent across screens that use SafeAreaView. This is a major problem for me because it makes some buttons unreachable throughout the app. I’m honestly considering switching back to the deprecated SafeArea for now.

EDIT : I also tried adding a SafeAreaProvider inside each _layout.tsx that uses SafeAreaView, at the route level. It seems to fix the safe area issue, but now I’m getting a layout flicker on the first load. The original safe area problem also only happened on the first app launch, so it might be related.

0xEzis avatar Dec 04 '25 11:12 0xEzis

I’m experiencing the same issue. When pushing a modal in expo-router, SafeAreaView from react-native-safe-area-context fails to apply insets on the first mount. It only starts working correctly from the second time onwards.

But, when I use the SafeAreaView from react-native it works well.

ahmeterenodaci avatar Dec 18 '25 12:12 ahmeterenodaci

Hi, any updates on this? Is anyone looking at it? Happy to contribute if needed. SafeAreaView breaks in modals

janroures avatar Dec 24 '25 10:12 janroures