Skip to content

feat(toggle-preloading): add param to disable preloading#7638

Open
Xenossolitarius wants to merge 1 commit into
nolimits4web:masterfrom
Xenossolitarius:toggle-lazyload-listeners
Open

feat(toggle-preloading): add param to disable preloading#7638
Xenossolitarius wants to merge 1 commit into
nolimits4web:masterfrom
Xenossolitarius:toggle-lazyload-listeners

Conversation

@Xenossolitarius

Copy link
Copy Markdown

Add ability to toggle preloading of images. If the user doesn't want to rely on the swiper implementation the user is unable to opt out of it and infers huge performance penalties.
More in #7570

Adds a `lazyPreload` option (default `true`, fully backward compatible).
When set to `false`, Swiper attaches no image `load` listeners and does no
preloader work:

- skips the capture-phase `load` listener on the root element, so onLoad ->
  swiper.update() no longer fires on every image load (the layout reflow that
  caused the performance issue);
- skips per-image `load` listeners attached at init;
- update() skips the [loading="lazy"] scan;
- processLazyPreloader/preload early-return.

Lets users who manage lazy loading themselves opt out of the reflows.

Closes nolimits4web#7570
@Xenossolitarius Xenossolitarius force-pushed the toggle-lazyload-listeners branch from 7fea02d to c358aa8 Compare June 13, 2026 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant