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.

bug: Ion Content in tabs will not scroll to bottom with collapsible header on iOS

See original GitHub issue

Bug Report

Ionic version: [x] 5.x

Current behavior: When a large list of items is added to a page with a collapsible header on iOS and the list of items includes an ion-icon placed inside of a slot, the page will not scroll completely down and will instead stop a few items short. (The remaining items can be seen in the overscroll). Changing tabs and coming back to the original tab will correct this issue.

Expected behavior: All items are visible after initial load.

Steps to reproduce:

  • Clone example repo linked below
  • Serve to a simulator or device (running in computer browser will not reproduce the issue, but the mobile safari browser can reproduce, or installing via Capacitor)
  • When the ion-icon in tab1 is present, the page will not scroll fully until after navigating away and back to tab1.
  • If the ion-icon in tab1 is removed, the page scrolls correctly on initial load.

Related code:

https://github.com/dallastjames/ionic-tabs-bug/blob/master/src/app/tab1/tab1.page.html

Other information:

Ionic info:

Ionic:
   Ionic CLI                     : 6.1.0 (/Users/pairing/.n/lib/node_modules/@ionic/cli)
   Ionic Framework               : @ionic/angular 5.0.1
   @angular-devkit/build-angular : 0.803.25
   @angular-devkit/schematics    : 8.3.25
   @angular/cli                  : 8.3.25
   @ionic/angular-toolkit        : 2.2.0
Capacitor:
   Capacitor CLI   : 1.5.0
   @capacitor/core : 1.5.0
Utility:
   cordova-res (update available: 0.9.0) : 0.8.1
   native-run                            : 0.3.0
System:
   NodeJS : v12.16.0 (/Users/pairing/.n/bin/node)
   npm    : 6.13.7
   OS     : macOS Mojave

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:23 (14 by maintainers)

github_iconTop GitHub Comments

4reactions
rossholdwaycommented, Jun 25, 2020

We’ve had to use a temporary CSS “hack” to workaround this as users were unable to reliably access menu items. Replace size="large" with class="title-large" and then add the following CSS to your global styles. Being global this may negatively impact other titles in your app, but it works for us.

.ion-cloned-element.ios.title-default {
  padding-top: 0px;
  bottom: 0px;
  align-items: flex-end;
  min-width: 100%;
  padding-bottom: 6px;
  font-size: 34px;
  font-weight: 700;
  text-align: start;
  padding-left: unset;
  padding-right: unset;
  padding-inline-start: 16px;
  padding-inline-end: 16px;
}

With the above class and global CSS applied, you still get the large title and page transition effects, but without the “scaling” of the title when pulling down on the page (that seems to be one transform-origin too many). The scaling is the same effect used on native, but I’d argue that losing this effect in return for content is more important. Maybe the scaling should be removed until a fix can be / is applied to the framework / webkit?

4reactions
DavidStrauszcommented, Feb 26, 2020

@liamdebeasi I also ran into this issue. It seems like the --offset-bottom css var of ion-content is not applied correctly. Simply unchecking + checking it again in inspector fixes the issue.

At first I thought its an angular CD bug, but no luck with manual change detection.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ionic 4 iOS scrolls TABS and not Content (header too)
This happens only on iOS, in android the tabs are NON SCROLL-ABLE. the user can scroll the content, but also it scrolls the...
Read more >
How to Hide Ionic Header on Scroll - YouTube
Learn to hide Ionic header on scroll by adding two simple but powerful directives that will change the Ionic header on scroll !...
Read more >
Ion-Accordion Components: How to Build & Examples | Ionic
Ion -accordion components provide collapsible sections in content to reduce vertical space and organize information. Learn how to build one and see examples....
Read more >
overscroll-behavior - CSS: Cascading Style Sheets | MDN
If you have overscroll-behavior: contain; selected, the outer container will not scroll unless you move your cursor out of the inner ...
Read more >
Announcing Ionic 6 - Ionic Blog
We have revamped the input styles in Material Design mode to support new filled and outline variants. We have also added error and...
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