Skip to content

bug: Platform MD ion-content wrong --offset-bottom #21130

Closed

Description

@StefanRein

Bug Report

Ionic version:
[x] 5.x

Where?
In the Ionic 5 tabs example.
On the iOS theme this works.
On the MD theme it does not work.

Current behavior:
<app-explore-container> has a wrong y-position in the tab, which was initially loaded.
The <ion-content> has on reload of the current tab a wrong offset of --offset-bottom:0px;

Expected behavior:
The <app-explore-container> component should have the same y-position on every tab on the MD (Material Design) theme.
should have an offset of --offset-bottom:57px; on reload of the current tab, as the other tabs have, if you switch to some other tab.

Steps to reproduce:
Start a new Ionic 5 Tab Project and open Chrome with the Pixel 2 responsive emulator and switch between the tabs. The content position will change.

Ionic info:

Ionic:

   ionic (Ionic CLI)             : 4.10.2 (/usr/local/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 5.0.7
   @angular-devkit/build-angular : 0.803.26
   @angular-devkit/schematics    : 8.3.26
   @angular/cli                  : 8.3.26
   @ionic/angular-toolkit        : 2.2.0

Cordova:

   cordova (Cordova CLI) : 8.1.2 ([email protected])
   Cordova Platforms     : ios 5.1.1
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.2.0, (and 4 other plugins)

System:

   Android SDK Tools : 25.2.3 (/Users/stefanrein/Library/Android/sdk)
   ios-sim           : 8.0.2
   NodeJS            : v10.15.3 (/usr/local/bin/node)
   npm               : 6.14.3
   OS                : macOS
   Xcode             : Xcode 11.4 Build version 11E146


Example, when the Tab1 URL was initially loaded: http://localhost:4200/tabs/tab1

image

https://github.com/ionic-team/starters/tree/master/angular/official/tabs

Activity

  1. added
    ionitron: needs reproduction
    on Apr 27, 2020
  2. ionitron-bot commented on Apr 27, 2020

    @ionitron-bot

    Thanks for the issue! This issue has been labeled as needs reproduction. This label is added to issues that need a code reproduction.

    Please provide a reproduction with the minimum amount of code required to reproduce the issue. Without a reliable code reproduction, it is unlikely we will be able to resolve the issue, leading to it being closed.

    For a guide on how to create a good reproduction, see our Contributing Guide.

  3. StefanRein commented on Apr 28, 2020

    @StefanRein
    Author

    Reproduction

    Please follow these steps to reproduce (from https://ionicframework.com/docs/intro/cli):

    Edit:
    Or clone following repository:
    https://github.com/ionic-team/starters/tree/master/angular/official/tabs

    npm uninstall -g ionic
    npm install -g @ionic/cli
    
    ionic start myApp tabs
    
    // Choose: ❯ Angular | https://angular.io 
    // ? Integrate your new app with Capacitor to target native iOS and Android? (y/N) 
    // Choose: N
    
    cd myApp/
    ionic serve
    
    // > ng run app:serve --host=localhost --port=8100
    

    Now on macOS Catalina it opens the latest Chrome Browser (Version 81.0.4044.129)

    1. Open the Developer Tools (Alt + CMD + i)

       The MD Mode is active.
       Switching between tabs: **It works as expected.**
      
    2. Chrome: Toggle Device Toolbar (the Mobile / Tablet icon)

    3. Select iPhone X and refresh the page (CMD + r)

       It has changed the mode to iOS.
       Switch between the tabs: **It works as expected.**
      
    4. Select Pixel 2 XL and refresh the page (CMD + r)

       It has changed the mode to MD.
       Switch between the tabs: **It does not work as expected.**
      

    The content jumps like I showed in the screenshots above if you draw a horizontal line between the text.


    Do you need further information?
    I am happy to provide you more information.

  4. added
    package: core
    type: bug
    and removed
    ionitron: needs reproduction
    on Apr 28, 2020
  5. moganarangan commented on Jul 29, 2020

    @moganarangan

    I did this -
    ionic start my-app tabs --type=angular

    Ionic serve

    By default the tabs loads first having this offset issue.

    The default opening tab have --offset-bottom:0px;

    Other tabs have --offset-bottom:56px;

  6. kevinboosten commented on Sep 8, 2020

    @kevinboosten

    @liamdebeasi my guess is that these issues al relate to each other: #21351 #21940 #20614

  7. taitdigital commented on Sep 12, 2020

    @taitdigital

    have come across this issue also, is there a temporary workaround?

    other than

    ion-content {
    --offset-bottom: 57px !important;
    }

  8. 1x2x3x4x commented on Dec 29, 2020

    @1x2x3x4x

    This isssue is still happening and also fails under iOS.

    ion-content { --offset-bottom: 50px !important; }

  9. eeschiavo commented on May 25, 2022

    @eeschiavo

    I have the same problem. Is there any solution?

  10. alexdabast commented on Mar 23, 2023

    @alexdabast

    To help for this bug you could call
    window.dispatchEvent(new Event('appload'));
    in your first tab page event ionWillEnterView

  11. added
    type: bug
    and removed
    type: bug
    on Sep 26, 2023
  12. liamdebeasi commented on Sep 27, 2023

    @liamdebeasi
    Contributor

    Hi everyone,

    Here is a dev build with a proposed fix if anyone is interested in testing: 7.4.2-dev.11695831341.191bdf12

    Install Example:

    npm install @ionic/[email protected]
    
  13. added a commit that references this issue on Oct 4, 2023
    7375dd6
  14. liamdebeasi commented on Oct 4, 2023

    @liamdebeasi
    Contributor

    Thanks for the issue. This has been resolved via #28245, and a fix will be available in an upcoming release of Ionic Framework.

  15. ionitron-bot commented on Nov 3, 2023

    @ionitron-bot

    Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

  16. locked and limited conversation to collaborators on Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    package: coretype: bug

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions