From 456b939fca90c4f070a70dec57edf110b3842165 Mon Sep 17 00:00:00 2001 From: Johann Schopplich Date: Wed, 13 Nov 2024 07:50:04 +0100 Subject: [PATCH] refactor: rename internal `skipChildren` option name --- packages/core/src/lazyLoad.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/core/src/lazyLoad.ts b/packages/core/src/lazyLoad.ts index f2e33bf..7ee1a15 100644 --- a/packages/core/src/lazyLoad.ts +++ b/packages/core/src/lazyLoad.ts @@ -195,7 +195,7 @@ function updateSizesAttribute( element: HTMLImageElement | HTMLSourceElement, options?: { updateOnResize?: boolean - skipChildren?: boolean + processSourceElements?: boolean }, ) { if (element.dataset.sizes !== 'auto') @@ -207,9 +207,9 @@ function updateSizesAttribute( element.sizes = `${width}px` // Calculate the `sizes` attribute for sources inside a `` element - if (isDescendantOfPicture(element) && !options?.skipChildren) { + if (isDescendantOfPicture(element) && options?.processSourceElements) { for (const sourceTag of [...element.parentElement.getElementsByTagName('source')]) { - updateSizesAttribute(sourceTag, { skipChildren: true }) + updateSizesAttribute(sourceTag, { processSourceElements: true }) } }