Ionic-framework: Ion-img position top relative to scrollable content instead of viewport

Created on 31 Mar 2017  路  3Comments  路  Source: ionic-team/ionic-framework

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:
Ion-img position top is calculated based on the position relative to the viewport instead of the scrollable container. If after loading the list data the content is scrolled programmatically, the lazy loading doesn't work anymore, because the values are wrong.

(I have a custom component that let's me load/replace list items of the content component when scrolling to the beginning or end of a list, to be able to paginate data (A variation of infinite scroll that works in two directions). After loading the second batch of list items I scroll down programmatically. Now the lazy loading of the images doesn't work anymore. The reason is the calculation of an image currently being inside the viewport uses the img top value relative to the viewport and not relative to the scrollable container, as it should be.)

Expected behavior:
Ion-img top value should be relative to the scrollable container, not the viewport.

Steps to reproduce:
This is only reproducable with my custom component, but I guess this will be an issue for other edge cases where one wants to scroll programmatically right after loading content.

stale issue

Most helpful comment

Thanks for opening an issue and a PR with us, we will look into this.

All 3 comments

I added a pull request #10999

Thanks for opening an issue and a PR with us, we will look into this.

Thanks for the issue! This issue is being closed due to inactivity. 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.

Thank you for using Ionic!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

giammaleoni picture giammaleoni  路  3Comments

BilelKrichen picture BilelKrichen  路  3Comments

manucorporat picture manucorporat  路  3Comments

danbucholtz picture danbucholtz  路  3Comments

brandyscarney picture brandyscarney  路  3Comments