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

Additional modal presentation styles #61

Merged
merged 7 commits into from
Dec 17, 2024

Conversation

svara
Copy link
Contributor

@svara svara commented Dec 17, 2024

This PR adds two modal styles: page sheet and form sheet. These styles differ in presentation only on iPads. On iPhones, they fallback to the same behavior:
• In portrait mode, the system displays the view controller as a sheet, with part of the background content visible near the top of the screen.
• In landscape mode, the behavior is identical to full screen presentation.

Page sheet Form sheet
page sheet form sheet

Additionally, this PR also adds the option to disable the pull-down gesture for the page and form sheet presentations. This is particularly important on iPads, where all it takes is an accidental tap outside of the sheet to dismiss it.
You can specify the behaviour by adding modal_sheet_dismiss_gesture_enabled to the path config. If omitted, the default value true is used, which matches the default OS behaviour.

{
   "rules":[
      {
         "patterns":[
            "/recipes/*"
         ],
         "properties":{
            "context": "modal",
            "modal_sheet_dismiss_gesture_enabled": false,
            "view_controller":"recipes"
         }
      }
   ]
}

Copy link
Contributor

@jayohms jayohms left a comment

Choose a reason for hiding this comment

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

Awesome, thanks!

@svara svara merged commit ed93291 into main Dec 17, 2024
1 check passed
@svara svara deleted the additional-modal-presentation-styles branch December 17, 2024 16:58
Comment on lines +21 to +22
case pageSheet
case formSheet
Copy link
Member

Choose a reason for hiding this comment

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

I hate to come in late after a merge, but I think these should be:

case pageSheet = "page_sheet"
case formSheet = "form_sheet"

to match Navigation.Presentation.clearAll and Navigation.Presentation.replaceRoot.

Copy link
Member

Choose a reason for hiding this comment

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

Addressed in PR #63.

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

Successfully merging this pull request may close these issues.

3 participants