You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: Ion Content in tabs will not scroll to bottom with collapsible header on iOS #20614
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.
@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.
Reacted by Ross Holdway, Sebastian Fiedlschuster and apolaina-ineat
It seems to me that scroll to bottom is working with just the collapsible header, but not when there is a footer (some of the content at the bottom is hidden behind the footer). Has anyone experienced this?
As @DavidStrausz says, it looks like the .inner-scroll of ion-content is not picking up the --offset-bottom CSS value, so it's not applied to the bottom property. I'm seeing this in the latest version of Ionic (5.0.7).
Seems to happen reliably for me when you have a list of content longer than the screen, and you then navigate to another page. On returning, you can't scroll to the end.
This is a separate issue that was not resolved by #20790. I am still trying to isolate the root cause of the issue. As of now it appears to be due to the presence of multiple transform-origin properties, but I am still digging into it.
The presence of the transform or transform-origin seems to cause iOS Safari / Webkit to be unable to see the "size" of the element, and so the content height is then calculated incorrectly on initial load. Changing tabs fixes it because it uses display: none which triggers a layout refresh. You can fix this issue (kind of) by applying position: relative to the ion-title however we then run into issues with padding and line-hight during the page change animation.
Yep that's what I am seeing as well. What is interesting though is the issue does not happen if you get rid of the ion-icon elements (in the example app in the original post). Likewise, if you kept the ion-icon elements and got rid of the collapsable header, the issue goes away. It seems like the presence of multiple transform-origin usages is what is causing it to break. I am not sure why that would cause things to break though.
Nope, I have not been able to isolate the issue (other than that it is related to transform-origin). It is possibly a bug in WebKit, but I have not been successful at reproducing this outside of Ionic yet.
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.
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?
Thanks for the issue. I am going to close this as the issue noted here appears to be a WebKit bug that has since been fixed. Starting with iOS 14.7, I can no longer reproduce the issue.
I recommend updating to the latest version of iOS to receive a fix for this. Thank you!
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.
Activity
DavidStrausz commentedon Feb 26, 2020
@liamdebeasi I also ran into this issue. It seems like the
--offset-bottomcss var ofion-contentis 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.
ahmadtawakol commentedon Mar 9, 2020
As a workaround that works nicely for now, add this at the end of your content
and put this in your css:
jahertor commentedon Mar 20, 2020
Still happens to me.
felixliu226 commentedon Mar 31, 2020
works for me
shanejearley commentedon Apr 10, 2020
It seems to me that scroll to bottom is working with just the collapsible header, but not when there is a footer (some of the content at the bottom is hidden behind the footer). Has anyone experienced this?
rossholdway commentedon Apr 27, 2020
As @DavidStrausz says, it looks like the
.inner-scrollofion-contentis not picking up the--offset-bottomCSS value, so it's not applied to thebottomproperty. I'm seeing this in the latest version of Ionic (5.0.7).Seems to happen reliably for me when you have a list of content longer than the screen, and you then navigate to another page. On returning, you can't scroll to the end.
DavidStrausz commentedon Apr 27, 2020
@rossholdway I think this was fixed in #20790 and it will be released with ionic 5.1.0 sometime soon :)
rossholdway commentedon May 1, 2020
Unfortunately it looks like #20790 hasn't fixed this. I still see it after updating to Ionic Angular v5.1.0
liamdebeasi commentedon May 1, 2020
This is a separate issue that was not resolved by #20790. I am still trying to isolate the root cause of the issue. As of now it appears to be due to the presence of multiple
transform-originproperties, but I am still digging into it.rossholdway commentedon May 7, 2020
Thanks for the update. Do you think a fix will make it into v5.1.1?
liamdebeasi commentedon May 7, 2020
Not at the moment. I need to figure out a fix for this first.
rossholdway commentedon May 12, 2020
Ok. Happy to take a look at this and dig a little deeper into the codebase
rossholdway commentedon May 13, 2020
It looks like this is an issue with the pull down effect enabled by adding the
size="large"attribute. Adding this sets atransformand atransform-originin theion-titleshadow DOM. https://github.com/ionic-team/ionic/blob/215d55f1ebeb93988b513c5869faae14d1d51919/core/src/components/header/header.utils.ts#L147-L156The presence of the
transformortransform-originseems to cause iOS Safari / Webkit to be unable to see the "size" of the element, and so the content height is then calculated incorrectly on initial load. Changing tabs fixes it because it usesdisplay: nonewhich triggers a layout refresh. You can fix this issue (kind of) by applyingposition: relativeto theion-titlehowever we then run into issues with padding and line-hight during the page change animation.liamdebeasi commentedon May 13, 2020
Yep that's what I am seeing as well. What is interesting though is the issue does not happen if you get rid of the
ion-iconelements (in the example app in the original post). Likewise, if you kept theion-iconelements and got rid of the collapsable header, the issue goes away. It seems like the presence of multipletransform-originusages is what is causing it to break. I am not sure why that would cause things to break though.TiagoDamascena commentedon Jun 17, 2020
Any news or a workaround to this issue?
liamdebeasi commentedon Jun 18, 2020
Nope, I have not been able to isolate the issue (other than that it is related to transform-origin). It is possibly a bug in WebKit, but I have not been successful at reproducing this outside of Ionic yet.
roman-rr commentedon Jun 23, 2020
Might be a temporary solution to use class title-large
instead of attribute size="large"
rossholdway commentedon 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"withclass="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.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-origintoo 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?kevinboosten commentedon Sep 4, 2020
I'm also seeing this behavior without the collapsable header and/or large title.
liamdebeasi commentedon Sep 4, 2020
@Boosten Can you reproduce this in an Ionic starter app and provide a link to the repo?
Hesesses commentedon Jan 21, 2021
any updates on this?
liamdebeasi commentedon Sep 17, 2021
Thanks for the issue. I am going to close this as the issue noted here appears to be a WebKit bug that has since been fixed. Starting with iOS 14.7, I can no longer reproduce the issue.
I recommend updating to the latest version of iOS to receive a fix for this. Thank you!
ionitron-bot commentedon Oct 17, 2021
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.