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-img> not appearing since 4.6.* (worked in 4.5.x)

See original GitHub issue

Bug Report

Ionic version: [x] 4.x

Current behavior:

Currently, the <ion-img> tags do not load when they are initially loaded in the viewport. They also do not reliably load when they are scrolled into the viewport from offscreen. I’m assuming something is broken with the load trigger in 4.6.x/Stencil One.

The strange part is that it works fine in Electron / Capacitor, but does not load on Chrome.

It seems to work a little better on Safari, but I do still see the issue occasionally with random images.

Which images fail to load seems random, but the same images fail each time on refresh, so that makes me think there’s something pseudorandom going on. Not 100% random.

Expected behavior:

ion-img should load its image when in the viewport.

Steps to reproduce:

I tried creating a sample app, but could not reproduce the issue. I really don’t know. As I mentioned, the images load fine in Electron/Capacitor, but do not load in native Chrome. And load better in Safari, but not 100%.

insert short code snippets here

Other information:

Ionic info:

Lincolns-MacBook-Pro-2:topdecked-unified lincoln$ ionic info

Ionic:

   Ionic CLI                     : 5.2.0 (/usr/local/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.6.1-dev.201907052128.7953088
   @angular-devkit/build-angular : 0.800.3
   @angular-devkit/schematics    : 7.3.1
   @angular/cli                  : 8.0.3
   @ionic/angular-toolkit        : 1.5.1

Cordova:

   Cordova CLI       : 8.1.2 (cordova-lib@8.1.1)
   Cordova Platforms : not available
   Cordova Plugins   : not available

Utility:

   cordova-res : not installed
   native-run  : not installed

System:

   Android SDK Tools : 26.1.1 (/usr/local/share/android-sdk)
   ios-deploy        : 1.9.4
   NodeJS            : v12.3.1 (/usr/local/Cellar/node/12.3.1/bin/node)
   npm               : 6.9.0
   OS                : macOS Mojave
   Xcode             : Xcode 10.2.1 Build version 10E1001


Tagging issue https://github.com/ionic-team/ionic/issues/18655

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:4
  • Comments:55 (10 by maintainers)

github_iconTop GitHub Comments

20reactions
lincolnthreecommented, Jul 11, 2019

Putting this here for others who might run across this problem. Setting a min-height on the ion-img element seems to resolve the issue:

in your global.scss (or other relevant stylesheet):

:root {
  ion-img {
    /** 
     * Bug fix for:
     * https://github.com/ionic-team/ionic/issues/18734
     */
    min-height: 1px !important;
  }
}
5reactions
lincolnthreecommented, Jul 9, 2019

@liamdebeasi Okay, I found something interesting. I set a min-height: 1px on the <ion-img> and that appears to have gotten things working. I’m going to do more testing and see if it breaks again.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ionic Forum
HI, I am using npm i @binssoft/ngx-captcha for ionic 6 application but i am getting error like NgxCaptchaModule' does not appear to be...
Read more >
Very Large Array Low-frequency Sky Survey Redux (VLSSr)
Existing radio surveys, including but not limited to the Australia ... by an error which led to images with almost no sources visible...
Read more >
i This page is for Thesis Access Form.
4.5. Atomic force micrographs (5 x 5 μm) of various gases plasma ... waveguide patterns designed for the process characterization work.
Read more >
WiFly Command Ref Guide Datasheet by SparkFun Electronics
4.6 FTP Client . ... Accurate sleep timer Yes (32 kHz) No (+/- 10% error) ... work. You can check your computer's IP...
Read more >
Life Cycle and Cost Assessments of Nutrient Removal ...
Acknowledgements Acknowledgements This work was overseen by members of an EPA ... 4-7 4.4 LCI Limitations 4-7 4.5 LCA Modeling Procedure 4-8 4.6...
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