Skip to content

Conversation

@kligarski
Copy link
Contributor

@kligarski kligarski commented Mar 24, 2025

Description

Brings back stackPresentation: 'modal''s size on iOS 18.0+.

Since the release of iOS 18, screens with stackPresentation: 'modal' changed size on devices with a bigger screen, such as an iPad - they became much smaller, which impacted applications of the library's users (see issue #2549). This happens because UIModalPresentationAutomatic, which is used by react-native-screens for modal on iOS, has been changed with the release of iOS 18. UIModalPresentationAutomatic is now mapped to UIModalPresentationFormSheet for iOS >=18 and UIModalPresentationPageSheet for earlier versions (this was the default before).

For more context please see PR #2793 but the TL;DR is that we consider this a breaking change for our users and therefore we decided to bring back the old behavior for react-native-screens v4 using prefersPageSizing property of the UISheetPresentationController which has been available since iOS 17.0+.

Resolves #2549.

Changes

  • use prefersPageSizing for modal on iOS 18.0+

Screenshots / GIFs

Before

Modal without prefersPageSizing on iOS 18

After

Modal with prefersPageSizing on iOS 18

Test code and steps to reproduce

Open Modals example screen and use Open modal button.

Checklist

  • Included code example that can be used to test this change
  • Ensured that CI passes

Copy link
Member

@kkafar kkafar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@kligarski kligarski requested a review from kkafar March 24, 2025 08:58
Copy link
Member

@kkafar kkafar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for remembering that the documentation must also change.

I think we should rephrase the description.

@kligarski kligarski requested a review from kkafar March 24, 2025 10:08
Copy link
Member

@kkafar kkafar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kligarski kligarski merged commit ac7154c into main Mar 24, 2025
6 checks passed
@kligarski kligarski deleted the @kligarski/restore-modal-behavior-on-ios branch March 24, 2025 11:14
kligarski added a commit to react-navigation/react-navigation that referenced this pull request Nov 24, 2025
**Motivation**

Since the release of iOS 18, screens with`presentation: 'modal'` changed
size on devices with a bigger screen, such as an iPad - they became much
smaller, which impacted applications of the library's users (see issue
software-mansion/react-native-screens#2549).

To address the issue, `react-native-screens` will introduce new
presentation type for native stack (`pageSheet`) that will allow users
to use previous modal behavior (see PR
software-mansion/react-native-screens#2793). The
behavior of `pageSheet` on Android will be the same as `modal`.

Please note that in `react-native-screens`, behavior of regular `modal`
has been aligned with previous behavior internally via
[`prefersPageSizing` UIKit
prop](software-mansion/react-native-screens#2797)
in order not to introduce breaking changes. In the future major release
of `react-native-screens` however this will be aligned to fully native
behavior.

This PR contains changes required to support `pageSheet` in
`react-navigation`.

**Test plan**

Open Stack Presentation and Modals example screens in example apps from
`react-native-screens` and open a `pageSheet`.
satya164 pushed a commit to react-navigation/react-navigation that referenced this pull request Nov 24, 2025
**Motivation**

Since the release of iOS 18, screens with`presentation: 'modal'` changed
size on devices with a bigger screen, such as an iPad - they became much
smaller, which impacted applications of the library's users (see issue
software-mansion/react-native-screens#2549).

To address the issue, `react-native-screens` will introduce new
presentation type for native stack (`pageSheet`) that will allow users
to use previous modal behavior (see PR
software-mansion/react-native-screens#2793). The
behavior of `pageSheet` on Android will be the same as `modal`.

Please note that in `react-native-screens`, behavior of regular `modal`
has been aligned with previous behavior internally via
[`prefersPageSizing` UIKit
prop](software-mansion/react-native-screens#2797)
in order not to introduce breaking changes. In the future major release
of `react-native-screens` however this will be aligned to fully native
behavior.

This PR contains changes required to support `pageSheet` in
`react-navigation`.

**Test plan**

Open Stack Presentation and Modals example screens in example apps from
`react-native-screens` and open a `pageSheet`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

presentation: 'modal' Screens are tiny on iPad / iOS18

3 participants