Skip to content

fix: render lazy charts already in viewport on page load#1287

Merged
HardeepAsrani merged 1 commit intodevelopmentfrom
fix/lady-load
Mar 20, 2026
Merged

fix: render lazy charts already in viewport on page load#1287
HardeepAsrani merged 1 commit intodevelopmentfrom
fix/lady-load

Conversation

@HardeepAsrani
Copy link
Copy Markdown
Member

Summary

The scroll listener for lazy charts never fired if the chart was already visible on page load, causing it to remain blank until the user scrolled. Extracted the logic into a named function with a viewport bounds check and call it once at page load in addition to on scroll.

Will affect visual aspect of the product

No

Screenshots

Test instructions

  • The charts should load when they come to viewport if lazy loading is enabled.
  • Previously, the charts which were in viewport when the page loaded weren't loading until the user scrolls. Make sure that isn't the case anymore.

Check before Pull Request is ready:

Closes https://github.com/Codeinwp/visualizer-pro/issues/526.

The scroll listener for lazy charts never fired if the chart was already
visible on page load, causing it to remain blank until the user scrolled.
Extracted the logic into a named function with a viewport bounds check and
call it once at page load in addition to on scroll.
@HardeepAsrani HardeepAsrani requested a review from abaicus March 17, 2026 11:45
@HardeepAsrani HardeepAsrani added the pr-checklist-skip Allow this Pull Request to skip checklist. label Mar 17, 2026
@pirate-bot pirate-bot added the pr-checklist-complete The Pull Request checklist is complete. (automatic label) label Mar 17, 2026
@pirate-bot
Copy link
Copy Markdown
Contributor

Plugin build for 4f8c2e1 is ready 🛎️!

@HardeepAsrani HardeepAsrani merged commit 50da22d into development Mar 20, 2026
12 checks passed
@HardeepAsrani HardeepAsrani deleted the fix/lady-load branch March 20, 2026 13:10
@pirate-bot
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 4.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@pirate-bot pirate-bot added the released Indicate that an issue has been resolved and released in a particular version of the product. label Mar 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-checklist-complete The Pull Request checklist is complete. (automatic label) pr-checklist-skip Allow this Pull Request to skip checklist. released Indicate that an issue has been resolved and released in a particular version of the product.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants