svelte-swipe icon indicating copy to clipboard operation
svelte-swipe copied to clipboard

Adding Images after init

Open CraigChamberlain opened this issue 3 years ago • 7 comments

If I init the gallery with an empty array of images which gets filled later by an aysnc request, the images are all displayed but there is no interactivity.

Can images be added dynamically?

CraigChamberlain avatar Mar 23 '21 14:03 CraigChamberlain

Noticed that issue a little while ago. Shortly I will start working on it. Thanks

SharifClick avatar Mar 26 '21 16:03 SharifClick

Thanks Sharif. Nice little gallery otherwise. I have it wrapped in an await so it doesn't render prematurely but nicer to let it bound to dynamic data.

CraigChamberlain avatar Mar 26 '21 16:03 CraigChamberlain

@CraigChamberlain I'm curious, what was your temporary approach with await?

My issue is that on the initial load, the slides I'm looping through appear on top of one another. I tried wrapping it in an await like so:

{#await $store then items}
	<Swipe {...swipeConfig} bind:this={SwipeComp}>
		{#each items as { title }}
			<SwipeItem>
			      {title}
			<SwipeItem />
		{/each}
	<Swipe />
{/await}

In my case, I'm making a GraphQL query and setting the store in the

nickjessop avatar May 13 '21 22:05 nickjessop

Hi,

I don't think I did any binding I just laid all the markup out in one file. I did do some css which gave the images a height andnaybe width while it initialised. Seems like a styling issue.

On Thu, 13 May 2021, 23:58 Nick Jessop, @.***> wrote:

@CraigChamberlain https://github.com/CraigChamberlain I'm curious, what was your temporary approach with await?

My issue is that on the initial load, the slides I'm looping through appear on top of one another. I tried wrapping it in an await like so:

{#await $store then items} <Swipe {...swipeConfig} bind:this={SwipeComp}> {#each items as { title }} <SwipeItem> {title} <SwipeItem /> {/each} <Swipe /> {/await} In my case, I'm making a GraphQL query and setting the store in the

CraigChamberlain avatar May 14 '21 17:05 CraigChamberlain

@nickjessop were you able to find a solution for this?

@SharifClick I'm also facing this issue - could you let us know if you're planning to work on it and the current status/ETA? Thanks!

aditivin avatar May 11 '23 20:05 aditivin

Hi @aditivin I am working on some bugs and features right now, will look into it shortly.

SharifClick avatar May 16 '23 11:05 SharifClick

I am experiencing the same issue on load, the slides all appear stacked on top of each another.

macsupport avatar Feb 22 '24 15:02 macsupport