leafOfTree/svelte-lazy

add id to placeholder container

Opened this issue · 2 comments

Hi,

I have a project where some buttons scroll to divs placed down the website. If I put the id prop in the slot that is passed inside Lazy it will not exist when the button is clicked because rendering didn’t happen yet.

I propose to have a prop in Lazy for passing the id and apply it to the placeholder instead, in theory it should scroll to the placeholder position and render the content.

Shouldn’t be too difficult, I can make a PR let me know if this sounds ok.

Hi,
Good point, it would be great if you can make a PR for it.

Sure thing, thanks for the quick reply, have a nice day!