question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Full screen modals don't appear full screen (iOS Safari)

See original GitHub issue

Description

When I open a full screen modal on iOS safari it does not fill the full screen. There’s a gap at the bottom the screen.

Link to Reproduction

https://chakra-ui-git-fix-modal-height-ios-chakra-ui.vercel.app/docs/overlay/modal#modal-sizes

Steps to reproduce

On an iPhone

  1. Go to https://chakra-ui-git-fix-modal-height-ios-chakra-ui.vercel.app/docs/overlay/modal#modal-sizes
  2. Click on "open full modal’
  3. full modal does not cover full screen when the safari navigators aren’t there (see attached image)

Chakra UI Version

1.6.4

Browser

Safari on iPhone X 14.7.1

Operating System

  • macOS
  • Windows
  • Linux

Additional Information

possibly caused by css styling below as removing it allows the modal to go full screen.

@supports (height: -webkit-fill-available)
modal:1.css-v9b9hc {
  height: -webkit-fill-available;
}

However the above code was added to solve this other issue: https://github.com/chakra-ui/chakra-ui/pull/3806

Image from iOS (2)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:12
  • Comments:6

github_iconTop GitHub Comments

7reactions
metanivekcommented, Oct 20, 2021

Is there a workaround to remove that specific CSS that seems to be causing the issue?

Edit: I found a workaround for my purposes. I’m not sure if this is the best way, or even a good idea, but sharing in case it is useful for others.

const customTheme = extendTheme({
  components: {
    Modal: {
      baseStyle: {
        dialogContainer: {
          "@supports(height: -webkit-fill-available)": {},
        },
      },
    },
  },
});
4reactions
KiranManthacommented, Nov 3, 2022

on top of @metanivek solution, i added height as well:

Modal: {
      baseStyle: {
        dialogContainer: {
          '@supports(height: -webkit-fill-available)': {},
          height: '100%'
        }
      }
    }

this worked for me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fullscreen for safari on Ipad - Apple Support Communities
Hi,. I would like to know can we view Safari in fullscreen mode for Ipad? If it is possible, how should I do...
Read more >
Present full screen modal from anywhere, without reference to ...
I would like to present a full screen ViewController without any knowledge about the current ViewController hierarchy.
Read more >
Fullscreen mobile modal. How hard can it be?
Let's talk about "fullscreen". How hard you expect it would be? Should be not hard - just use fullscreen div with z-index and...
Read more >
How to present a full screen modal view using fullScreenCover()
Learn Swift coding for iOS with these free tutorials.
Read more >
View Controller Presentation Changes in iOS 13
Default Modal Presentation Style Change ... The default presentation is now page sheet, not full screen. The header documentation for modalPresentationStyle says:.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found