Ionic-framework: bug[core, v5]: ion-content height 100% not inherited

Created on 11 Jan 2020  路  18Comments  路  Source: ionic-team/ionic-framework

Bug Report

Ionic version:
[x] 5.x

Current behavior:
In Ionic v5.x (current status, tested with @next and master) it will not be possible anymore to assign an height: 100% to the slotted element of the ion-content respectively such property will be ignored.

This would for example have for effect to break the GUI of our editor (see attached Gif).

The root cause of the issue, I think, is the recent introduction of the ion-content shadowed child <div id="scroll-content"/> (see related commit)

Expected behavior:
Still being able to use height: 100% for the content with Ionic v5.x.

Steps to reproduce:

git clone https://github.com/peterpeterparker/ionic-v5beta-content-height.git
cd ionic-v5beta-content-height
npm install
npm run start

Related code:

See demo repo

Other information:

Demo of our application (gif):

ezgif com-video-to-gif-2

Screenshots of the provided repo:

Capture d鈥櫭ヽran 2020-01-11 脿 18 14 21

Capture d鈥櫭ヽran 2020-01-11 脿 18 14 28

And a screenshot of the same repo with Ionic v4:

Capture d鈥櫭ヽran 2020-01-12 脿 08 35 12

core bug

Most helpful comment

Thanks! This issue has been resolved via https://github.com/ionic-team/ionic/pull/20194. We will be putting out a new beta soon that has this fix.

All 18 comments

Thanks for the issue. Can you try the following dev build and let me know if it resolves your issue:

npm i @ionic/[email protected]

@liamdebeasi thank you for your feedback. same problem with build 202001131408.8aeda3a.

Hmm maybe I'm not quite sure what you are trying to do. From what I understand, you are expecting the scrollable content to take up 100% of the available containing height by default. From there, you want to be able to control the overall dimensions of ion-content by setting the dimension on ion-content directly. Is that correct?

@liamdebeasi yes

<ion-content>
    <div style="height: 100%">
    </div>
</ion-content>

height or min-height too I guess.

here a screenshot from our editor in prod with v4:

Capture d鈥櫭ヽran 2020-01-13 脿 17 08 01

Thanks for the follow up. Try this dev build:

npm i @ionic/[email protected]

super @liamdebeasi 202001131622.bfc6420 do solve the issue, thx!

I checked both the sample repo and our app.

Capture d鈥櫭ヽran 2020-01-13 脿 17 30 53

I'm noticing the problem as well @liamdebeasi also with build 202001131408.8aeda3a

all my zero states don't center on the page anymore 馃槮

image

@corysmc Please try 5.0.0-dev.202001131622.bfc6420. That previous build had a mistake in it.

should have refreshed the page before submitting my comments 馃槃
The latest build works now 5.0.0-dev.202001131622.bfc6420

Thanks @liamdebeasi!

Thanks! This issue has been resolved via https://github.com/ionic-team/ionic/pull/20194. We will be putting out a new beta soon that has this fix.

Thank you Liam 馃憤

@liamdebeasi @peterpeterparker Unfortunately, this fix breaks elements with "position: sticky" inside the ion-content scroll-content div. Now that the height is set to 100%, once the div scrolls off screen, any sticky items (such as floating buttons/widgets/etc) scroll off screen with it.

This occurs when the height of the content contained inside the scroll-element exceeds 100% of the ion-content/viewport.

IMO: This should probably use the 'min-height: 100%' property, instead of 'height'.

Sample repo incoming.

@lincolnthree Can you open a new issue? Thanks!

Sure thing.

@liamdebeasi Done.

Hello, the problem still persists with the latest version 5.0.0-rc.0.

Any idea ?

regards,
Achille

@LOUNNAS Please open a new issue. Thanks!

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

brandyscarney picture brandyscarney  路  3Comments

alexbainbridge picture alexbainbridge  路  3Comments

vswarte picture vswarte  路  3Comments

Nick-The-Uncharted picture Nick-The-Uncharted  路  3Comments

SebastianGiro picture SebastianGiro  路  3Comments