Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PrismicImage lazy loading Svelte #18

Open
GalichCZ opened this issue Dec 21, 2023 · 1 comment
Open

PrismicImage lazy loading Svelte #18

GalichCZ opened this issue Dec 21, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@GalichCZ
Copy link

GalichCZ commented Dec 21, 2023

I have an issue with handling images with slow internet connection in svelte app using prismic library
I've tried to use on:load like this

<script>
  import { PrismicImage } from '@prismicio/svelte'

  const a = () => {
    console.log(1)
  }
</script>
<PrismicImage
        on:load={a}
        on:loadeddata={()=>console.log(1)}
        on:loadedmetadata={()=>console.log(1)}
        loading='lazy'
        style="position: absolute; z-index: 1; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 3rem; -webkit-clip-path: url(#{pathID}); clip-path: url(#{pathID});"
        {field}
        imgixParams={{ q: 30 }}
      />

but there is no any reaction on load and I do not really see any difference if I have loading='lazy'

It is the copy paste of my question on prismic community.

My suggestion is pretty simple, it would be nice to have working on:load handlers in PrismicImage component

BTW, thank you for easy understandable webs and docs :D

@GalichCZ GalichCZ added the enhancement New feature or request label Dec 21, 2023
Copy link

This issue has been labeled as a feature request since it was created using the 🙋‍♀️ Feature Request Template.

Hi there, thank you so much for your request!

Following our Maintenance Process, we will review your request and get back to you soon. If we decide to implement it, will proceed to implement the feature during the last week of the month. In the meantime, feel free to provide any details to help us better understand your request, such as:

  • The context that made you think of this feature request
  • As many details about the solution you'd like to see implemented, how it should behave, etc.
  • Any alternative solution you have considered

If you think you can implement the proposed change yourself, you're more than welcome to open a pull request implementing the new feature. Check out our quick start guide for a simple contribution process. Please note that submitting a pull request does not guarantee the feature will be merged.

- The Prismic Open-Source Team

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant