Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

fix: Image on canvas in latest chrome may not render when loading is lazy (#2902)

Oleg Isonenb3b1792eaed8
diff --git a/packages/sdk-components-react/src/image.tsx b/packages/sdk-components-react/src/image.tsx
index 6f98b91a31..b7020f1ff6 100644
--- a/packages/sdk-components-react/src/image.tsx
+++ b/packages/sdk-components-react/src/image.tsx
@@ -37,7 +37,12 @@ type Props = Omit<ComponentPropsWithoutRef<typeof WebstudioImage>, "loader">;
export const Image = forwardRef<ElementRef<typeof defaultTag>, Props>(
({ loading = "lazy", ...props }, ref) => {
- const { imageLoader, assetBaseUrl } = useContext(ReactSdkContext);
+ const { imageLoader, renderer, assetBaseUrl } = useContext(ReactSdkContext);
+
+ if (renderer === "canvas") {
+ // With disabled cache and loading lazy, chrome may not render the image at all
+ loading = "eager";
+ }
if (
props.src === undefined ||