Closed r3Fuze closed 6 months ago
It's not possible to use the on:load event when using the CldImage component.
on:load
CldImage
Expose the on:load event so it can be used.
Example:
<CldImage src={publicId} alt="My image" width={256} height={256} on:load={() => console.log("Image loaded")} />
For now I've just reverted to using the underlying @unpic/svelte Image component since it exposes the on:load event.
@unpic/svelte
Image
It might be as simple as adding on:load to the CldImage component in src/lib/components/CldImage.svelte like it is done in the @unpic/svelte Image component: https://github.com/ascorbic/unpic-img/blob/main/packages/svelte/src/lib/image.svelte#L42
:tada: This issue has been resolved in version 1.3.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
Feature Request
Is your feature request related to a problem? Please describe.
It's not possible to use the
on:load
event when using theCldImage
component.Describe the solution you'd like
Expose the
on:load
event so it can be used.Example:
Describe alternatives you've considered
For now I've just reverted to using the underlying
@unpic/svelte
Image
component since it exposes theon:load
event.Additional context
It might be as simple as adding
on:load
to theCldImage
component in src/lib/components/CldImage.svelte like it is done in the@unpic/svelte
Image
component: https://github.com/ascorbic/unpic-img/blob/main/packages/svelte/src/lib/image.svelte#L42