swyxio/svelte-actions

discuss `pannable` action

Opened this issue · 2 comments

export function pannable(node: HTMLElement): ReturnType<Action>

Creates panstart, panmove, panend events so you can drag elements.

<div class="box"
	use:pannable
	on:panstart={handlePanStart}
	on:panmove={handlePanMove}
	on:panend={handlePanEnd}
></div>

Demo: https://svelte.dev/tutorial/actions

Hey @sw-yx! Don't know what you had planned for this issue, but I've noticed that this Demo doesn't work on mobile, any ideas why that would be?

no idea, i just copied it straight from the official tutorial..