Skip to content
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

Cards with lazy loading images #354

Closed
cloewen8 opened this issue Sep 18, 2020 · 8 comments
Closed

Cards with lazy loading images #354

cloewen8 opened this issue Sep 18, 2020 · 8 comments
Labels

Comments

@cloewen8
Copy link

Description

If an element is appended that includes an img with the loading="lazy" attribute. All cards will fail to be laid out. Optimally these elements should be appended and positioned as if they did not have the image (optionally with the width and height applied ahead of time), then re-positioned when the image loads at a later point.

Steps to check or reproduce

This can be reproduced using any grid with images:

  1. Navigate to https://codepen.io/pen/?&editable=true=https%3A%2F%2Fnaver.github.io%2Fegjs-infinitegrid%2Fassets%2Fhtml%2Fgrid.html
  2. In the JS section, change (line 1)
var template = '<div class="item"><div class="thumbnail"><img src="${link}../../assets/image/${no}.jpg"></div><div class="info">${text}</div></div>';

to (adding loading="lazy")

var template = '<div class="item"><div class="thumbnail"><img loading="lazy" src="${link}../../assets/image/${no}.jpg"></div><div class="info">${text}</div></div>';
@daybrush
Copy link
Member

@cloewen8

Thank you. Native image lazy loading has not yet been applied. We will add it later.

@stale
Copy link

stale bot commented Oct 24, 2020

This issue/PR has been automatically marked as stale because it has not had any update (including commits, comments, labels, milestones, etc) for 30 days. It will be closed automatically if no further update occurs in 7 day. Thank you for your contributions!

한글 이 이슈/PR은 commits, comments, labels, milestones 등 30일간 활동이 없어 자동으로 stale 상태로 전환되었습니다. 이후 7일간 활동이 없다면 자동으로 닫힐 예정입니다. 프로젝트 개선에 기여해주셔서 감사합니다.

@stale stale bot added the stale label Oct 24, 2020
@cloewen8
Copy link
Author

No updates, but also not resolved. Just patient waiting here.

@daybrush
Copy link
Member

@cloewen8

Sorry for the long wait. I am going to start working. I plan to release it with another PR.

@stale stale bot removed the stale label Oct 26, 2020
@cloewen8
Copy link
Author

No worries. I consider lazy loading to be more of a nicity then a requirement.

daybrush added a commit to daybrush/egjs-infinitegrid that referenced this issue Nov 27, 2020
daybrush added a commit that referenced this issue Dec 4, 2020
* feat: support native lazy loading #354

* fix: change ready module

* test: test lazy loading

* fix: remove useless code

* skip: apply review

* chore: update imready version

* feat: add contentError event

* fix: fix destroy method

* test: test loading manual test

* fix: fix startLoading, endLoading parameter

* chore: update imready
@daybrush
Copy link
Member

daybrush commented Dec 4, 2020

@cloewen8

@egjs/infinitegrid 3.7.0 is released. Try it.

@cloewen8
Copy link
Author

cloewen8 commented Dec 4, 2020

Works on my machine. I have it queued up to test on a production website later tonight, I'll let you know if I encounter any problems.

@cloewen8
Copy link
Author

cloewen8 commented Dec 6, 2020

Works great!

@cloewen8 cloewen8 closed this as completed Dec 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants