Skip to content

bug: --ion-safe-area-bottom has no effect and bottom is cut off #30922

@fudom

Description

@fudom

Prerequisites

Ionic Framework Version

v8.x

Current Behavior

--ion-safe-area-bottom: 50px has no effect. Top works fine, but not bottom.

Expected Behavior

Expected a safe area at bottom. But nothing changes. If top padding is present, it should not move the whole app down! Bottom should always at bottom, not in offscreen. And bottom should respect safe area bottom. Either scroll content or everything (just like top).

For testing:

html {
  --ion-safe-area-top: 50px;
  --ion-safe-area-bottom: 50px;
}

Another bug: Safe area top moves all down and cause cut up bottom.

Steps to Reproduce

  1. Test ion-safe-area by override value and play around. See playground.

Code Reproduction URL

https://stackblitz.com/edit/angular-ywh4p1-akj8gswd?file=src%2Fglobal.css

Ionic Info

Ionic 8

Additional Information

The entire main layout, including ion-content, etc., appears to be wrong. I haven't yet examined the Ionic source code, but it doesn't look like a clean flex layout. The ion-content is pushing even the ion-footer. And safe area bottom only affects to the footer but not to e.g. scroll padding, etc. Or better the whole app. Maybe it's because the inner-scroll is absolute in full area with calc etc. That's not so good.

Update: When I set bottom of ion-content .inner-scroll to 106px (or without 50px safe area top: 56px) which is ion-header, than the ion-content is not cut off. So, the ion-header pushes it down and ion-content has no idea that the header exists. But this will work better in a flex layout. Why this decition of absolute pos with calc instead of safe flex layout? But anyway, what's wrong here?

Workaround:

ion-content::part(scroll) {
  /* Override bottom with 56px for ion-header + safe area 50px. That's not good! */
  bottom: 106px;
}

But it would be great if this worked without hacks to fix the framework. What am I missing? What's wrong here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs: replythe issue needs a response from the user

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions