Skip to content

Commit f928905

Browse files
authored
Normalize is-tiled-image attribute string to boolean. (#325)
HTML attributes are always strings, so "false" is always being treated as "truthy." This causes the web component to always fetch info.json in tiled image mode. Instead, this change explicitly compares against true/"true" to correctly handle all attribute values.
1 parent 0da6c9d commit f928905

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/web-components/clover-image.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,13 @@ const CloverImageWebComponent: FC<
3535
}
3636
}, [props, props.__registerPublicApi]);
3737

38-
return <Image label={ariaLabel} isTiledImage={isTiledImage} src={src} />;
38+
return (
39+
<Image
40+
label={ariaLabel}
41+
isTiledImage={isTiledImage === true || isTiledImage === "true"}
42+
src={src}
43+
/>
44+
);
3945
};
4046

4147
const cloverViewerWCProps = ["aria-label", "src", "is-tiled-image"];

0 commit comments

Comments
 (0)