# svelte-dnd
> Drag and drop for Svelte 5: nested zones, touch, keyboard and screen reader support.
# Getting started
`@lukez/svelte-dnd` is a drag and drop library for Svelte 5. You write a list with an `#each` block, put one attachment on its container, and the user can sort it with the pointer, a touch screen or the keyboard.
## Install
```bash
pnpm add @lukez/svelte-dnd
```
```bash
npm install @lukez/svelte-dnd
```
```bash
yarn add @lukez/svelte-dnd
```
The peer range is `svelte ^5.32.0`, because the library uses attachments. It has no other dependencies.
## A first list
```svelte
({ items, flipDurationMs, onconsider: update, onfinalize: update }))}>
{#each items as item (item.id)}
{item.name}
{/each}
```
Four things make this work:
- `dndzone` is an attachment. It turns the `` into a zone and each of its direct children into a draggable item. It takes a function that returns the options, so it reads your current `items` each time they change.
- Every item has an `id`, and the `#each` block uses it as its key. Keyed blocks are required.
- `onconsider` and `onfinalize` get the event directly. `e.items` is the list the zone should render, and `e.info` says what happened.
- `flipDurationMs` is given to the options and to `animate:flip`, so the library and the animation agree on how long a move takes.
See [Options](/docs/api/options) for every option the getter can return.
## Why you write `items` back twice
The library never changes your list. It tells you what the list should look like, and you assign it:
- `onconsider` runs again and again while the user drags: the item has entered the zone, moved over another index, or left. The `items` it gives you include a temporary placeholder, so the other items make room. Render that list to show the user where the item would land.
- `onfinalize` runs when the item is dropped, in the zone the item was dropped into and in the zone it came from. The `items` it gives you are the final list. A pointer drag sends it once, at the end. A keyboard drag sends it on every arrow key and ends with an `onconsider`, so read [saving after a drag](/docs/guides/keyboard-and-screen-readers#saving-after-a-drag) before you save to a server from it.
Both handlers usually do the same thing, `items = e.items`, so the sample above shares one function. They are two options because they mean different things: a drag in progress and a result. The library relies on both to keep your list in step with the drag, so do not leave either one out. [How it works](/docs/how-it-works) explains the full lifecycle.
## Next steps
- [How it works](/docs/how-it-works): the consider and finalize lifecycle, the placeholder item, zone types and item ids.
- [Options](/docs/api/options): every option of a zone.
- The guides: [drag handles](/docs/guides/drag-handles), [nested zones](/docs/guides/nested-zones), [keyboard and screen readers](/docs/guides/keyboard-and-screen-readers), [styling](/docs/guides/styling) and more.
# How it works
## You own the items
A zone does not hold state. You give it `items`, the list you render in your `#each` block, and the library reads the DOM and the pointer to work out what the list should become. It does not assign to your list. It calls `onconsider` and `onfinalize` with the proposed list, and you decide what to do with it. In most apps that is `items = e.items`.
Because of that, the library works with any state you have: a `$state` array, a prop, a store, or a list you copy and send to a server before you accept it.
## Consider and finalize
Every event has the same shape: `e.items` is the list the zone should render, and `e.info` describes what happened.
- `onconsider` is for a drag in progress. It fires as the dragged item enters a zone, moves over another index, or leaves. Render the list you receive so the other items make room.
- `onfinalize` is for a result. It fires when the item is dropped, in the zone the item was dropped into and in the zone it came from, if that is another one. A pointer drag sends it once, when the drag ends. A keyboard drag drops the item on every arrow key, so it sends `onfinalize` on every move, and ends with an `onconsider` with the `DRAG_STOPPED` trigger. To save to a server once per drag, see [saving after a drag](/docs/guides/keyboard-and-screen-readers#saving-after-a-drag).
`e.info` has three fields: `trigger`, the kind of event, `id`, the id of the dragged item, and `source`, which is `"pointer"` or `"keyboard"`. Most apps ignore it. Copy on drag and similar behaviors use it.
The triggers are the values of the exported `TRIGGERS` object. Triggers marked pointer only never happen in a keyboard drag.
| Event | Trigger (`TRIGGERS.…`) | Sent to, and when |
| ------------ | ------------------------- | --------------------------------------------------------------------------------------------- |
| `onconsider` | `DRAG_STARTED` | The zone the drag started from. |
| `onconsider` | `DRAGGED_ENTERED` | A zone the item entered. Pointer only. |
| `onconsider` | `DRAGGED_ENTERED_ANOTHER` | The zone the drag started from, when the item enters another zone. Pointer only. |
| `onconsider` | `DRAGGED_OVER_INDEX` | A zone, when the item moves over another index of it. Pointer only. |
| `onconsider` | `DRAGGED_LEFT` | A zone the item left. Pointer only. |
| `onconsider` | `DRAGGED_LEFT_ALL` | The zone the drag started from, when the item is outside of every zone. Pointer only. |
| `onconsider` | `DRAG_STOPPED` | The zone, when the user ends a keyboard drag. Keyboard only. |
| `onfinalize` | `DROPPED_INTO_ZONE` | The zone the item was dropped into. A keyboard drag sends it each time an arrow key moves it. |
| `onfinalize` | `DROPPED_INTO_ANOTHER` | The zone the item came from, when it is dropped into another zone. |
| `onfinalize` | `DROPPED_OUTSIDE_OF_ANY` | The zone the item came from, when it is dropped outside of every zone. Pointer only. |
A drag within one zone sends `onfinalize` to that zone only. A drag from one zone to another sends it to both, so both lists must be updated. That is another reason to keep the handlers simple: assign what you get.
## The shadow item
During a pointer drag, the zone the item hovers over receives a temporary item in its `items`: the shadow item. It is a copy of the dragged item's data with two changes:
- its id starts as `SHADOW_PLACEHOLDER_ITEM_ID`. Once the dragged element has left the list, the shadow item takes the dragged item's own id, so the id is not a reliable way to find it.
- it has the property `isDndShadowItem` set to `true`. The name is exported as `SHADOW_ITEM_MARKER_PROPERTY_NAME`. Check this marker to recognise the shadow item.
It is what makes the other items move aside, and it marks where the item would land. While it is in the list, the element it renders is the placeholder under the dragged element, which follows the pointer. When the drag ends, the shadow item is replaced by the dragged item with its real id.
Check the marker in your `#each` block to style the placeholder:
```svelte
```
Two more things to know about it:
- Your rendering code sees it, so a nested zone that filters or counts items must expect it. Filter on the `isDndShadowItem` marker when you pass `items` down to a nested zone.
- With nested zones, mark the item with `data-is-dnd-shadow-item-hint={item.isDndShadowItem}` so the library does not set up zones inside the placeholder. See [nested zones](/docs/guides/nested-zones#the-shadow-hint).
Keyboard drags do not add a shadow item. The item moves in the list directly.
## Zone types
By default every zone has the same type, so an item can move between any two zones. Give zones a `type` to limit that: an item can only be dropped in a zone of its own type.
```svelte
({ items: todo, type: "task", onconsider: updateTodo, onfinalize: updateTodo }))}>
```
Items in zones of the same type are expected to have the same shape, because an item can be added to any of them without conversion. `dropFromOthersDisabled` stops a zone from taking items from other zones, and `dragDisabled` stops its items from being dragged, without changing types. Both are in the [options](/docs/api/options).
## Item ids and `configure`
Every item needs a unique id, and the `#each` block uses it as its key. The id is the `id` property by default. If your data uses another name, such as `_id` for PouchDB, change it once, globally, with `configure`:
```svelte
```
It applies to every zone, and it throws while any zone is mounted, so call it before any zone renders: at the top of your root layout's `
{#each items as item (item.id)}
{item.name}
{/each}
```
After:
```svelte
({ items, flipDurationMs: 200 }))}>
{#each items as item (item.id)}
{item.name}
{/each}
```
The getter is required. Passing a plain object is a type error.
Reassign `items`, do not change it in place. The library notices a change because the getter reads the `items` binding, so `items = next` works and `items.push(x)` on its own does not. This is the same rule as in `svelte-dnd-action`, and the callbacks below hand you a new array to assign.
You can keep all the options in one `$state` object and return it, as `() => options` or `() => ({ ...options })`. The library copies the top level of what the getter returns inside the effect, so it reads each option and sees a write such as `options.items = e.items` or `options.dragDisabled = true`. A change deeper down, such as `options.items.push(x)`, is not seen, the same as for `items` above.
## Events became callbacks
The `consider` and `finalize` DOM events are gone. Pass `onconsider` and `onfinalize` in the options instead. The callback receives what `e.detail` used to hold, so `e.detail.items` becomes `e.items` and `e.detail.info` becomes `e.info`.
Before:
```svelte
```
The callbacks fire at the same points as the old events. The library no longer dispatches `consider` or `finalize` on the element, so an `onconsider={...}` attribute on the element does nothing. Put the callbacks in the options.
When you let TypeScript infer the types, the item type flows from `items` into the callbacks, and you can write `onconsider: (e) => (items = e.items)`.
### `info.id` is not typed as a string
`info.id` is the raw value of the item's id key, not a string. Its type is inferred from the item's `id` field, so `{ id: number }` items give a `number`. An optional `id` field (`{ id?: number }`) also gives `number`, without `undefined`, because the id is required at runtime. An item type with no `id` field gives `unknown`: that is the case with a custom `idKey`, and for the default `Item` type. Narrow an `unknown` id before string-only use.
## Global setters became `configure`
The four global setters are replaced by one function, [`configure`](/docs/api/configure). Keys that you leave out are not touched, so `configure({ ariaStrings })` on a locale change leaves the keyboard trigger as it was.
| Before | After |
| ---------------------------------------------------- | --------------------------------------- |
| `overrideItemIdKeyNameBeforeInitialisingDndZones(k)` | `configure({ idKey: k })` |
| `setKeyboardDragTrigger(t)` | `configure({ keyboardDragTrigger: t })` |
| `setAriaStrings(s)` | `configure({ ariaStrings: s })` |
| `setDebugMode(b)` | `configure({ debug: b })` |
Before:
```js
import {
overrideItemIdKeyNameBeforeInitialisingDndZones,
setKeyboardDragTrigger,
setAriaStrings,
setDebugMode,
} from "svelte-dnd-action";
overrideItemIdKeyNameBeforeInitialisingDndZones("key");
setKeyboardDragTrigger("enter");
setAriaStrings({ zoneActiveInstruction: "Press enter to pick up an item" });
setDebugMode(true);
```
After:
```js
import { configure } from "@lukez/svelte-dnd";
configure({
idKey: "key",
keyboardDragTrigger: "enter",
ariaStrings: { zoneActiveInstruction: "Press enter to pick up an item" },
debug: true,
});
```
Behavior to know about:
- `keyboardDragTrigger` is `"space"`, `"enter"` or `"space_or_enter"` (the default). `null` restores the default.
- `ariaStrings` is a full locale over the English defaults. `null` restores English.
- `idKey` throws while any zone is mounted, as before. Call it once at app start. A value that is not a string throws too.
- An unknown key throws, so a typo fails loudly.
- `configure` only sets module state and touches no DOM, so it is safe to call during SSR.
## The feature flag became a zone option
`setFeatureFlag` and `FEATURE_FLAG_NAMES` are removed. The only flag, `USE_COMPUTED_STYLE_INSTEAD_OF_BOUNDING_RECT`, is now the `useComputedStyleForRects` [option](/docs/api/options) of the zone. It is a workaround for grid layouts, so set it on the zone that has the grid. Other zones keep the default (`false`).
Before:
```js
import { setFeatureFlag, FEATURE_FLAG_NAMES } from "svelte-dnd-action";
setFeatureFlag(FEATURE_FLAG_NAMES.USE_COMPUTED_STYLE_INSTEAD_OF_BOUNDING_RECT, true);
```
After:
```svelte
({ items, useComputedStyleForRects: true }))}>
{#each items as item (item.id)}
{item.name}
{/each}
```
## Drag handles are attachments
[`dragHandleZone` and `dragHandle`](/docs/api/drag-handles) are attachments too (see the [drag handles guide](/docs/guides/drag-handles)). Put `{@attach dragHandleZone(() => options)}` on the zone and `{@attach dragHandle}` on each handle element. `dragHandle` is used as it is, without a function call.
Before:
```svelte
```
A handle finds the nearest handle zone around it. A handle outside any handle zone does nothing. When `debug` is on, each such handle logs one debug message when it is removed.
### `dragDisabled` is per handle zone
Before, the `dragDisabled` option of one handle zone leaked into the handles of every other handle zone on the page. Now it applies to the handles of its own zone only. A zone with `dragDisabled: true` stops its own handles and leaves the others alone.
Nested handle zones follow the same rule: the handles inside an inner zone answer to the inner zone's `dragDisabled`, and the outer zone's `dragDisabled` does not reach them.
Dragging an item from one handle zone into another still works. While a drag is running, every handle zone accepts it, and all of them are disabled again when it ends.
```svelte
```
Here the handles of the left list are locked, and the handles of the right list still work.
## Nested zones and the shadow item hint
A zone nested inside an item of another zone works as before (see the [nested zones guide](/docs/guides/nested-zones)). While an item is dragged, its zone shows a shadow item in its place, and Svelte renders the nested zone inside the shadow item too. To keep that copy from registering as a second zone for the length of the drag, mark the shadow item's element with `data-is-dnd-shadow-item-hint`, as in `svelte-dnd-action`:
```svelte
```
Under strict TypeScript, the item type needs the optional field `[SHADOW_ITEM_MARKER_PROPERTY_NAME]?: boolean` (that is, `isDndShadowItem?: boolean`), because the engine sets it on the shadow item.
Fixed in this release: in `svelte-dnd-action`, with the hint, the nested zone of the dragged item stayed dead after the drop. The library skipped a zone created inside a marked element and never set it up later, and after the drop the shadow item's element stays on as the dropped item's element. Now the skipped zone is set up as soon as the hint is removed, so the dropped item's nested zone takes drags again ([#7](https://github.com/The-LukeZ/svelte-dnd/issues/7)).
## Type changes
- The public generics take `T extends object`, so an `interface` works as an item type. Before, only types with an index signature did.
- `transformDraggedElement` receives the zone's item type: `TransformDraggedElementFunction` is `(element?, draggedElementData?: T, index?) => void`.
- `DndZoneAttributes` is removed. There are no event attributes left to type.
- `DndEventInfo` takes the item type, `DndEventInfo`, and `id` is inferred from the item's `id` field instead of typed `string`, see above.
- `Item` is `Record` instead of `Record`. Code that leaves the item type out, such as a handler typed `(e: DndEvent) => ...`, gets `unknown` values, so `e.items[0].name` no longer compiles. Pass your item type, as in `DndEvent`, or let TypeScript infer it from `items`.
- New types: `DndConfig` (the argument of `configure`). See the [types reference](/docs/api/types) and the [events reference](/docs/api/events).
## Removed exports
| Removed | Use instead |
| ------------------------------------------------------------------------------------------------------------- | -------------------------------------------------- |
| `setAriaStrings`, `setKeyboardDragTrigger`, `setDebugMode`, `overrideItemIdKeyNameBeforeInitialisingDndZones` | `configure` |
| `setFeatureFlag`, `FEATURE_FLAG_NAMES` | the `useComputedStyleForRects` zone option |
| type `DndZoneAttributes` | nothing, `onconsider` and `onfinalize` are options |
Still exported and unchanged: `alertToScreenReader`, `TRIGGERS`, `SOURCES`, `SHADOW_ITEM_MARKER_PROPERTY_NAME`, `SHADOW_PLACEHOLDER_ITEM_ID`, `DRAGGED_ELEMENT_ID`, and the type `AriaStrings`. Still exported, with the changes listed under [Type changes](#type-changes): the types `Options`, `DndEvent`, `DndEventInfo`, `Item`, `TransformDraggedElementFunction`.
All other zone options keep their names and meaning.
# History of svelte-dnd-action
`@lukez/svelte-dnd` is a fork of [`svelte-dnd-action`](https://github.com/isaacHagoel/svelte-dnd-action) by Isaac Hagoel. These are the upstream release notes up to version 0.9.80. They describe the old API, with `use:dndzone` and the `consider` and `finalize` events. To move your code to this library, read [Migrating from svelte-dnd-action](/docs/migrating).
## Svelte Dnd Action - Release Notes
### [0.9.80](https://github.com/isaacHagoel/svelte-dnd-action/pull/709)
Feature: support dndzones in same-origin iframes and other windows, including pointer and keyboard interaction, document-local screen-reader instructions and announcements, scrolling, and cleanup when the window closes. Thanks to [@chhoumann](https://github.com/chhoumann) for [#708](https://github.com/isaacHagoel/svelte-dnd-action/pull/708).
- Use the zone's own window for events, timers, animation frames and computed styles, so drags continue when the loading window is hidden.
- Both pointer and keyboard transfers stay within the document they started in. Lists inside an iframe or popup work normally, but neither input transfers items between documents.
- Custom screen-reader announcements accept an optional document: `alertToScreenReader(text, zone.ownerDocument)`.
- Enforce keyboard drop restrictions even when a disabled or other-type destination is focused by a click or application code.
- Restrict keyboard reordering to the grabbed item, leaving arrow keys in nested controls and unrelated items untouched.
- Exclude lists nested inside the grabbed item from destination styling and move-between-lists announcements.
- Keep mid-pointer-drag styles and classes limited to eligible destinations, including empty lists, removing the previously applied styling when options change.
### [0.9.79](https://github.com/isaacHagoel/svelte-dnd-action/pull/707)
Bugfix: keep drop-position detection accurate while list items are moving with Svelte's `animate:flip`, preventing the shadow element from becoming stuck at a previously visited position. Fixes [#706](https://github.com/isaacHagoel/svelte-dnd-action/issues/706).
### [0.9.78](https://github.com/isaacHagoel/svelte-dnd-action/pull/702)
Feature: add global `setKeyboardDragTrigger` configuration for choosing whether _Space_, _Enter_ or either key starts and stops keyboard dragging.
- Leave the unselected key completely untouched so applications can use it for actions such as opening or editing the focused item.
- Apply the setting consistently to every dndzone and drag handle, including changes made after zones have rendered.
- Keep the built-in screen-reader instruction synchronized and support trigger-aware translated instructions.
### [0.9.77](https://github.com/isaacHagoel/svelte-dnd-action/pull/698)
Feature: add `setAriaStrings` for localizing the built-in screen-reader instructions and keyboard-drag announcements.
- Override any subset of messages with formatter functions that receive item, zone, position and count context.
- Update the document-wide locale at runtime while keeping English defaults for omitted messages.
- Preserve the library's existing ARIA roles and behavior without enabling `autoAriaDisabled`.
### [0.9.76](https://github.com/isaacHagoel/svelte-dnd-action/pull/695)
Bugfix: include the originating drop-zone label in keyboard drag announcements so screen-reader users hear the list name from drag start and while reordering within the list.
### [0.9.75](https://github.com/isaacHagoel/svelte-dnd-action/pull/694)
Bugfix: keep an active keyboard drag synchronized when a consumer re-render moves or removes the grabbed item.
- Follow an item moved between same-type zones without losing focus or cross-zone keyboard navigation.
- End the drag safely if the item disappears instead of moving an unrelated item from a stale origin.
- Keep zones of other types isolated even when they use the same item id.
### [0.9.74](https://github.com/isaacHagoel/svelte-dnd-action/pull/691)
Bugfix: prevent nested `dragHandleZone` teardown during an active drag from broadcasting a stale update that can hide a real item as the shadow element.
### [0.9.73](https://github.com/isaacHagoel/svelte-dnd-action/pull/690)
Bugfix: preserve the cursor's relative grab point when a dragged element morphs again before its previous size transition completes. Size and position transitions are also synchronized when the first morph happens before delayed transition setup.
### [0.9.72](https://github.com/isaacHagoel/svelte-dnd-action/pull/689)
Bugfixes: harden drag lifecycle cleanup against timing-sensitive updates and teardown.
- Keep pointer observation tied to the exact zones being watched, including when zone types change during an animated drop.
- Cancel pending pointer and delayed-touch gestures when their owning zone is destroyed, and serialize simultaneous touch starts.
- Prevent stale animation frames from reattaching zones after drop cleanup has destroyed them.
- Make keyboard drop handling safe when event handlers synchronously destroy the focused zone.
- Destroy the wrapped dndzone when a `dragHandleZone` action is destroyed.
### [0.9.71](https://github.com/isaacHagoel/svelte-dnd-action/pull/688)
Bugfix: prevent the original-element animation-frame loop from restarting pointer observation while a drop is finalizing, avoiding an uncaught `getBoundingClientRect` error on fast animated drops. Adds defensive observer cleanup for the same race. Fixes [#687](https://github.com/isaacHagoel/svelte-dnd-action/issues/687).
### [0.9.70](https://github.com/isaacHagoel/svelte-dnd-action/pull/685)
Bugfix: stop the `keepOriginalElementInDom` animation-frame loop after a drag is finalized, preventing a delayed crash when the original element leaves the DOM.
### [0.9.69](https://github.com/isaacHagoel/svelte-dnd-action/pull/679)
Feature: Added `useCursorForDetection` option.
- Uses cursor position instead of dragged element's center for drop zone detection.
- Improves accuracy when dragging large elements over small drop targets.
### [0.9.68](https://github.com/isaacHagoel/svelte-dnd-action/pull/650)
Bugfix - dragHandleZones are now testable within playwright
### [0.9.67](https://github.com/isaacHagoel/svelte-dnd-action/pull/675)
Bugfix - very tall elements/zones detection logic fix.
### [0.9.66](https://github.com/isaacHagoel/svelte-dnd-action/pull/670)
Tiny fix to prevent an error when in Svelte 5 runes mode
### [0.9.65](https://github.com/isaacHagoel/svelte-dnd-action/pull/665)
No changes, just added a shameless plug to the Readme for github and NPM
### [0.9.64](https://github.com/isaacHagoel/svelte-dnd-action/pull/657)
Bugfix: change the handling of positioning the shadow element as the last child to support complex layouts like flex-wrap
### [0.9.63](https://github.com/isaacHagoel/svelte-dnd-action/pull/652)
Feature: Added `delayTouchStart` option to improve touch-device UX.
- Allows distinguishing quick scroll gestures from drag starts.
- Accepts **boolean** (`true` = 80 ms default) or **number** (custom delay in ms).
### [0.9.62](https://github.com/isaacHagoel/svelte-dnd-action/pull/651)
Bugfix: the dragHandle now respects the `dragDisabled` prop
### [0.9.61](https://github.com/isaacHagoel/svelte-dnd-action/pull/645)
Bugfix: Fixed an issue in `dragHandle` where clicking and releasing without dragging left `isItemsDragDisabled` as `false`, making the entire element draggable.
### [0.9.60](https://github.com/isaacHagoel/svelte-dnd-action/pull/639)
Bugfix: the touchend listener was emulating a click using the click() function and that broke when the user clicked on an SVG
### [0.9.59](https://github.com/isaacHagoel/svelte-dnd-action/pull/638)
Bugfix: fixed an issue that affected $state (for items) that was introduced by version 0.9.58
### [0.9.58](https://github.com/isaacHagoel/svelte-dnd-action/pull/636)
Svelte 5 $state users (if you store items as $state) - please skip this version!
Bugfix: when the items in the origin zone shrink in height right on drag start, the pointer would find itself outside the dragged element
### [0.9.57](https://github.com/isaacHagoel/svelte-dnd-action/pull/629)
Readme update (`on` vs `on:` handlers in Svelte 5)
### [0.9.56](https://github.com/isaacHagoel/svelte-dnd-action/pull/628)
Fixed dndzones inside an element with the 'popover' attribute
### [0.9.55](https://github.com/isaacHagoel/svelte-dnd-action/pull/626)
Fixed logic that could leave the shadow element invisible after drop if the dom wasn't yet updated to reflect the data list (rare)
### [0.9.54](https://github.com/isaacHagoel/svelte-dnd-action/pull/621)
Readme REPL links updated repl -> playground
### [0.9.53](https://github.com/isaacHagoel/svelte-dnd-action/pull/618)
Added a check to address edge cases where multiScroller is undefined when accessed on destroy
### [0.9.52](https://github.com/isaacHagoel/svelte-dnd-action/pull/610)
Fixed a bug that affected dndzone inside scrollable parents - calculated the target index incorrectly when the element was above a hidden part of the zone
### [0.9.51](https://github.com/isaacHagoel/svelte-dnd-action/pull/608)
Added the option to disable the final drop animation
### [0.9.50](https://github.com/isaacHagoel/svelte-dnd-action/pull/598)
Fixed a bug where library would crash when a store updated "considers" in local storage from another tab
### [0.9.49](https://github.com/isaacHagoel/svelte-dnd-action/pull/588)
Fixed a bug where library would crash if one of the canvas had an empty size
### [0.9.48](https://github.com/isaacHagoel/svelte-dnd-action/pull/582)
Fixed a bug where the scroller would stay active and scroll the page after drop
### [0.9.47](https://github.com/isaacHagoel/svelte-dnd-action/pull/578)
Added examples to the README (for the drag handles wrapper actions).
### [0.9.46](https://github.com/isaacHagoel/svelte-dnd-action/pull/576)
Added two wrapper actions (`dragHandleZone` and `dragHandle`) to make using drag handle easy.
### [0.9.45](https://github.com/isaacHagoel/svelte-dnd-action/pull/573)
Bug fix - calling transformDraggedElement after the element was morphed so that changes transform makes aren't overridden by the morphing.
### [0.9.44](https://github.com/isaacHagoel/svelte-dnd-action/pull/567)
Allows Svelte 5.0.0-next as peer dependency.
### [0.9.43](https://github.com/isaacHagoel/svelte-dnd-action/pull/556)
Fixes an issue on some touch devices, where attempting to drag an item causes the page to scroll.
### [0.9.42](https://github.com/isaacHagoel/svelte-dnd-action/pull/553)
Fixes that won't affect most use cases (but do affect recursive nesting).
Fixed updating the items config prior to configure being called.
Restored using the real id throughout the drag operation after the initial frame to prevent issues from implementations relying on it.
This affects the each loop key should be set up when using `data-is-dnd-shadow-item-hint` (see README).
### [0.9.41](https://github.com/isaacHagoel/svelte-dnd-action/pull/549)
The library can now scroll dropzones and any scrollable element that contains dropzones inside, including the window.
This happens when the mouse pointer is near one of the edges of a scrollable container during drag.
### [0.9.40](https://github.com/isaacHagoel/svelte-dnd-action/pull/542)
Added custom events typings with generics to support TypeScript out of the box.
### [0.9.39](https://github.com/isaacHagoel/svelte-dnd-action/pull/538)
Updated README to help set up sveltekit + typescript
### [0.9.38](https://github.com/isaacHagoel/svelte-dnd-action/pull/533)
Added fault tolerance for use cases in which the user removes the shadow item from the list (e.g zones with limited slots)
### [0.9.37](https://github.com/isaacHagoel/svelte-dnd-action/pull/532)
Added support for class instances as list items
### [0.9.36](https://github.com/isaacHagoel/svelte-dnd-action/pull/528)
Added `import` and `require` to the export block in package.json so that types are properly resolved.
### [0.9.35](https://github.com/isaacHagoel/svelte-dnd-action/pull/527)
Added an export block to package.json to remove a Svelte 5 (actually vite) warning about the deprecated "svelte" entry
### [0.9.34](https://github.com/isaacHagoel/svelte-dnd-action/pull/524)
Don't use this version please. It has a silly mistake that cause an error with Sveltekit 2
### [0.9.33](https://github.com/isaacHagoel/svelte-dnd-action/pull/499)
bugfix - now works properly inside a `