-
Notifications
You must be signed in to change notification settings - Fork 13.4k
fix(modal, popover): respect safe area insets on popovers and modals #30949
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
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Deployment failed with the following error: |
| // <app-footer><ion-footer>...</ion-footer></app-footer>). | ||
| let hasContent = false; | ||
| let hasFooter = false; | ||
| for (const child of Array.from(el.children)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason we don't use querySelectorAll to get all content descendants?
| export interface SafeAreaConfig { | ||
| top: string; | ||
| bottom: string; | ||
| left: string; | ||
| right: string; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't we use this instead of string?
| export interface SafeAreaConfig { | |
| top: string; | |
| bottom: string; | |
| left: string; | |
| right: string; | |
| } | |
| type SafeAreaValue = "0px" | "inherit"; | |
| export interface SafeAreaConfig { | |
| top: SafeAreaValue; | |
| bottom: SafeAreaValue; | |
| left: SafeAreaValue; | |
| right: SafeAreaValue; | |
| } |
Issue number: resolves #28411
What is the current behavior?
When a modal is displayed on tablet-sized screens (>= 768px × >= 600px), the
--ion-safe-area-*CSS variables are explicitly set to 0px. This was intended for inset modals that don't touch screen edges, but it breaks safe area handling on newer iPads with Face ID/home indicators, causing content to overlap with system UI elements.What is the new behavior?
Modals now dynamically handle safe-area insets based on their type and position. This has to be done because modals that don't touch the edges cannot have a safe area applied (because it will add unnecessary padding), but modals that do touch the edges need to apply safe area correctly or the edges will be obstructed by whatever is in the safe area.
Does this introduce a breaking change?
Other information
Modals test page
Popovers test page
Current dev build: