Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted January 1, 20232 yr Hello, I've discovered a bug in how IPS' lazyloading works on dynamic elements. in ./dev/js/library/app.js, line 61, you define a hook/override for $.fn.html. This makes sure that if dynamically loaded HTML contains lazyload elgible content, you instate the lazyload handler on it. The problem seems to be instead of looping each lazyload element, ips.utils.lazyLoad.observe is called on the entire element. This then registers the IntersectionObserver on the entire element, causing each lazyloading element to be loaded straight away, defeating the point of the lazyload. The fix is to instead call ips.utils.lazyLoad.observe on each lazyload capable element, like it's done elsewhere in the suite. I have patched this locally, but thought it would be useful to share to the IPS developers. Happy new year! Edited January 1, 20232 yr by G17 Media
February 1, 20232 yr Author Bump - this is a big issue for forums which are image or embed heavy and go beyond 1 page. This would also benefit those Cloud customers to fix 😉 Edited February 1, 20232 yr by G17 Media
February 2, 20232 yr Bump2 Bump3 I've logged an internal bug report so we can evaluate further. We do want to move more towards the native browser lazyload (such as we've done in Gallery) however we need to consider the trade-offs. The native functionality also has the same drawback as this bug where it won't work on dynamically loaded content.