diff options
-rw-r--r-- | packages/astro/src/runtime/client/dev-overlay/plugins/audit/index.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/packages/astro/src/runtime/client/dev-overlay/plugins/audit/index.ts b/packages/astro/src/runtime/client/dev-overlay/plugins/audit/index.ts index ac45616b1..175fe0ab6 100644 --- a/packages/astro/src/runtime/client/dev-overlay/plugins/audit/index.ts +++ b/packages/astro/src/runtime/client/dev-overlay/plugins/audit/index.ts @@ -135,7 +135,7 @@ export default { margin: 0; font-size: 22px; } - + astro-dev-toolbar-icon { width: 1em; height: 1em; @@ -187,13 +187,13 @@ export default { // If the element is hidden, don't do anything if (targetedElement.offsetParent === null || computedStyle.display === 'none') { - audits.push(); return; } - // If the element is an image, wait for it to load + // If the element is an image but not yet loaded, ignore it + // TODO: We shouldn't ignore this, because it is valid for an image to not be loaded at start (e.g. lazy loading) if (originalElement.nodeName === 'IMG' && !(originalElement as HTMLImageElement).complete) { - await (originalElement as HTMLImageElement).decode(); + return; } const rect = originalElement.getBoundingClientRect(); |