-
Notifications
You must be signed in to change notification settings - Fork 13.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RC4 ion-img doesn't correctly work with virtualScroll #9660
Comments
I have the same issue with my app since updating to rc4. |
I am facing the similar issue with RC 4, in RC 3 it was working fine. |
Same issue on my end |
try using just "img" instead of "ion-img". Worked for me. |
"ion-img" stopped working for me in rc4, too (even without virtual scroll). Could replacing with "img" cause some performance issues in longer lists? |
@sajTempler yes it works but we loose the performance benefits such lazy loading that comes with ion-img |
You can still use ng2 lazy loader. There are two or more. I'm using this one https://github.com/tjoskar/ng2-lazyload-image |
Ciao folks,
Img.prototype.ngAfterContentInit = function () {
I hope in quickly fix by Ionic team:) |
Hello all! Thanks for using Ionic! Could someone post a repo that i can use to reproduce this issue? |
@jgw96 I emailed you a sample |
Do you still have the problem? The "ion-img" does not work as expected on my app, but I can not find an explanation for the moment |
Same here. Was this fixed? |
@naveedahmed1 Could you post your sample here? I'm not sure we're talking about the same problem |
We also ran into this issue with our non-virtualScroll grid. We reproduced the issue in a plunker. Seems to work fine in a finite (non-virtualScroll) list. Whenever we add ion-infinite-scroll to the list the ion-images show issues with loading and unloading. So 'normal' lists seem to work just fine. Lists with virtualScroll or infiniteScroll seem to have issues. |
RC5 - same issue |
Well apparently ion-img should only be used in conjunction with virtualScroll: |
I have exactly the same behavior as @pavimus After the virtual scroll buffer, image does not appear, css class is "img-unloaded" (see screenshot below) with ionic 2 final. Please, could you communicate on this problem? |
I have this bug also in latest ionic |
As we really needed this to work in our scrollable grid of images (ion-grid, without virtual scroll), we have temporarily replaced the After some digging around it appears that the top and bottom of an ion-img are not relative to the absolute top of the container it is in, causing the wrong images to be loaded/unloaded. See lines 231 and 242 of the gist for the workaround. We also tried extending ion-img, but without much success. And building a (temporary) custom version of the Ionic dist files and using that as a local dependency also appears to be more complicated than we thought. So while the Ionic team works on this, we will be using this workaround. |
@sajTempler Is it possible to load images only when scroll stopped with that plugin? |
This bug and some more (images not responsive and only 5x5 on chrome/android, images not loading on first start before any scrolling..) broke a production app which heavily relies on showing articles with lazy loaded images. |
@ventr1x I also wonder what devs are doing because this critical bug is still open from december 16 |
It's just plain broken (it never really worked, in beta it wasn't even mentioned in any doc). I switched to ng2-lazyload-image and got it working with rc6 like that (so some might not go through the same non documented things..): Component
View |
@ventr1x Is it possible to load images only when user stopped scrolling with this plugin? |
@jgw96 any status update? |
Same problem here.. |
I agree @nicolus the Ionic team don't realize that virtualscroll/ion-img is not working and that virtualscroll is not working with ion-refresh. @HugoHeneault @manucorporat @adamdbradley |
@HugoHeneault I haven't really worked with ion-img at all. I probably should have, but haven't. I can take a look but I don't have a reference on what is broken. @nicolus the entry in the changelog is from a PR I submitted myself that fixes a regression issue in virtual scroll. I understand your frustration, but that PR fixed a particular issue with VS that made it unusable when the underlying data set was getting updated often, it was not a complete rewrite of the component that solved all issues. I too agree that VS needs a lot more attention but it has two main issues that probably make its maintenance unviable:
This complexity is too much for a PR to handle and it requires a complete redesign about what virtual scroll does (which means it has to align with ionic team's goals), how it does it and what interactions with other components it should have. Moving to ionic v4 I think many of these will change |
@masimplo : you're right, I forgot that virtual scroll is used for a lot more than just ion-img (because that's what I personally use it for). |
I hope for a quick fix on this one. Are there any news? Is this investigated by the team? |
I hope in a fix too |
@RafaelKr @fdambrosio I think it's better not to hope for any fixes on components before v4 is released. Unfortunately for us working with ionic3, we have to deal with buggy components or to fix them by ourselves. Feel free to fix & create PR ;) |
+1 |
try using this way <ion-img [src]="image.url" [alt]="image.alt"> |
still waiting for a fix... |
You have to wait for ionic v4. @miqmago: Please read here for further information: |
#9660 (comment) worked |
I had same issue of showing image in inside [virtualScroll] how do i fix them. |
It would be stupid to believe that it will be fixed in Ionic 4. |
@mopi1402 I know that how issues have been handled by ionic team in the past isn't really good. But if you want to learn how they will handle versioning and upcoming issues, you should read Don't forget that ionic framework is open sourced and that anyone can help fixing issues. :) |
I agree @mopi1402 this is one of the most used feature |
Still not working in v4 beta. |
it's no good that it's not working with Ionic 4 |
Ionic is an open source software guys, if you want things to get fixed quickly you can create a patch and submit a PR 👍 |
@HugoHeneault : It's open source software that I pay $29 a month through my pro subscription (I mean sure the framework itself is free, but it's not like they're a non-profit organization, they give the framework for free on order to make money on subscriptions), so I don't expect to have to fix it myself for free. I can understand that it's a hard issue to fix, that ionic 4 is still beta, that it's a low priority issue... All those are perfectly valid reasons, but "it's OSS fix it yourself lol" is not. |
@nicolus You're quite right, and I've also been complaining when the services I pay for were not working. But we should keep in mind that even if Ionic company might be making money from premium services, many devs from their teams are working a lot and need to earn their living... for a free tool that anyone can use without paying. For me it's the way OSS work: you have no obligation on paying their services and can create awesome apps without giving a cent, but they provide services to make your life easier. I'm also paying for many pro subscriptions which doesn't mean I can't help when a fix is possible without spending days on it. |
This issue has been automatically identified as an Ionic 3 issue. We recently moved Ionic 3 to its own repository. I am moving this issue to the repository for Ionic 3. Please track this issue over there. If I've made a mistake, and if this issue is still relevant to Ionic 4, please let the Ionic Framework team know! Thank you for using Ionic! |
Issue moved to: ionic-team/ionic-v3#148 |
Ionic version: (check one with "x")
[ ] 1.x
[x ] 2.x
I'm submitting a ... (check one with "x")
[x ] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/
Current behavior:
When you use virtualScroll and ion-img, after scrolling down (when buffer ends) ion-img stops loading images
Please look at code inspector:
url http://base247.lin2/thumbs/c6/files_56_222bf7a3335ce7c20553f0f374eb0266b871af41.jpg_mobileListImage_1412346660_3.jpg
is correct (for my local machine) and image is available.
Expected behavior:
ion-img must load images
Steps to reproduce:
Related code:
Other information:
Bug appeared in RC4, in RC3 all was OK.
Ionic info: (run
ionic info
from a terminal/cmd prompt and paste output below):The text was updated successfully, but these errors were encountered: