History of svelte-dnd-action
The release notes of the upstream library, svelte-dnd-action, up to version 0.9.80, the version this fork started from.
History of svelte-dnd-action up to v0.9.80
@lukez/svelte-dnd is a fork of 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.
Svelte Dnd Action - Release Notes
0.9.80
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 for #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
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.
0.9.78
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
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
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
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
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
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
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
dragHandleZoneaction is destroyed.
0.9.71
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.
0.9.70
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
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
Bugfix - dragHandleZones are now testable within playwright
0.9.67
Bugfix - very tall elements/zones detection logic fix.
0.9.66
Tiny fix to prevent an error when in Svelte 5 runes mode
0.9.65
No changes, just added a shameless plug to the Readme for github and NPM
0.9.64
Bugfix: change the handling of positioning the shadow element as the last child to support complex layouts like flex-wrap
0.9.63
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
Bugfix: the dragHandle now respects the dragDisabled prop
0.9.61
Bugfix: Fixed an issue in dragHandle where clicking and releasing without dragging left isItemsDragDisabled as false, making the entire element draggable.
0.9.60
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
Bugfix: fixed an issue that affected $state (for items) that was introduced by version 0.9.58
0.9.58
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
Readme update (on vs on: handlers in Svelte 5)
0.9.56
Fixed dndzones inside an element with the ‘popover’ attribute
0.9.55
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
Readme REPL links updated repl -> playground
0.9.53
Added a check to address edge cases where multiScroller is undefined when accessed on destroy
0.9.52
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
Added the option to disable the final drop animation
0.9.50
Fixed a bug where library would crash when a store updated “considers” in local storage from another tab
0.9.49
Fixed a bug where library would crash if one of the canvas had an empty size
0.9.48
Fixed a bug where the scroller would stay active and scroll the page after drop
0.9.47
Added examples to the README (for the drag handles wrapper actions).
0.9.46
Added two wrapper actions (dragHandleZone and dragHandle) to make using drag handle easy.
0.9.45
Bug fix - calling transformDraggedElement after the element was morphed so that changes transform makes aren’t overridden by the morphing.
0.9.44
Allows Svelte 5.0.0-next as peer dependency.
0.9.43
Fixes an issue on some touch devices, where attempting to drag an item causes the page to scroll.
0.9.42
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
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
Added custom events typings with generics to support TypeScript out of the box.
0.9.39
Updated README to help set up sveltekit + typescript
0.9.38
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
Added support for class instances as list items
0.9.36
Added import and require to the export block in package.json so that types are properly resolved.
0.9.35
Added an export block to package.json to remove a Svelte 5 (actually vite) warning about the deprecated “svelte” entry
0.9.34
Don’t use this version please. It has a silly mistake that cause an error with Sveltekit 2
0.9.33
bugfix - now works properly inside a <dialog> element
0.9.32
Fixed canvas content not getting cloned on dragged node.
0.9.31
Introduce zoneItemTabindex - It allows the user to set custom tabindex to the list container items when not dragging. Can be useful if you use Drag handles
0.9.30
This version introduces a way for the user to set the flipdurationms to 0, and have it actually have 0 animation (20ms or 1 frame animation). Useful for gaming as before the 100ms minimum made it so that it was too slow.
0.9.29
This version addresses some issues around nested zones. By-default the shadow element now has a temporary id until it’s dropped.
This version also adds the option to provide a hint data attribute (data-is-dnd-shadow-item-hint) that helps the lib optimise when there is a lot of nesting (see readme).
0.9.28
A revert of the problematic part in 0.9.27. This version is functionally equal to 0.9.26
0.9.27
PLEASE DON’T USE THIS VERSION An unsuccessful attempt to support for dropzone being added mid-drag. It breaks in nested scenarios.
0.9.26
Readme typo fix in an example: setFeatueFlag -> setFeatureFlag
0.9.25
Made the fix that was introduced in version 0.9.23 available via feature flag but inactive by default
0.9.24
Updated readme with Svelte 4 types configuration
0.9.23
Fix morphing when within css grid
0.9.22
Fix repl examples in Readme. Add svelte >=3.23.0 as peerDependency
0.9.21
transformDraggedElement is called even if morphing is disabled and a bug that has to do with morphing is now fixed (it was moving the element before styling it)
0.9.20
update README to fix global.d.ts example
0.9.19
enhancement: DndEvent now allows the use of generics.
0.9.18
fix: if a drop zone is removed mid-drag it was causing the lib to throw errors
0.9.17
fix: dropdowns (select elements) will now maintain their value during drag
0.9.16
fixed a bug that made dropTargetClasses and dropTarget styles work incorrectly when applied to nested zones
0.9.15
made the aria support more friendly for multi-page apps (ex: SvelteKit) by having the lib lazy init and clean up the aria divs when the last instance is removed
0.9.14
fixed an issue with items sometimes not making way for the dragged element after autoscroll
0.9.13
fixed the typescript type for dropTargetClasses
0.9.12
added a link example for a basic implementation of multi-drag in the README
0.9.11
added a new option, zoneTabIndex, that allows to set custom tabindex in the list container.
0.9.10
Please do not use. It was deployed with unintended changes
0.9.9
bugfix - works properly when under shadow dom
0.9.7
bugfix - works properly now when dropFromOtherDisabled is set to true while the shadow element is in the zone
0.9.5
added a new option, morphDisabled, that allows to disable morphing of dragged item.
0.9.4
bug fix - not crashing when a new dnd zone is created mid drag
0.9.3
exporting DRAGGED_ELEMENT_ID to allow targeting the dragged element and its subtree using CSS or to fetch it with document.getElementById.
0.9.2
fixed a race condition that could happen under extremely rapid drag-start -> drop while spam-clicking feverishly
0.9.1
exporting SHADOW_PLACEHOLDER_ITEM_ID for easier filtering in recursive zones use-cases
0.9.0
added the centreDraggedOnCursor option to deal with zones that have large items (wide, tall or both) in them that can be dragged over much smaller items.
in these cases, having the center of the items (which is the focal point that triggers all dnd events), and the cursor be the same point makes it more intuitive to drag the large items around.
0.8.6
fixed an issue when dragging an item on top of a droppedFromItemsDisabled zone (it is treated as outside of any now, as it should)
0.8.4
fixed a keyboard related bug - it is now possible to tab back to the dragged item after tabbing to external elements mid drag
0.8.2
accessibility features now work when the library is dynamically imported (in other words, keyboard navigation now works in the REPL again).
0.8.1
Made dropTargetClasses when initiating drag via keyboard.
v0.8.0
Added a new option, dropTargetClasses, that allows adding global classes to a dnd-zone when it is a potential drop target (during drag).
v0.7.4
This release introduces a subtle change to the dragStarted event.
If you are using Dragula Copy on Drag, you will need to update your consider handler (add 1 line of code to remove the newly added shadow placeholder, see linked REPL).
Same goes for the crazy nesting example
Starting with this version, the initial consider event (dragStarted) places a placeholder item with a new id instead of the dragged item in the items list (old behaviour: removing the dragged item from the list altogether). The placeholder is replaced with the real shadow element (the one that has the same id as the original item) in the next event (basically instantly).
This change makes the initial behaviour of large items (relative to their peers) much smoother.
v0.7.0
All the changes in this release only affect pointer (mouse/ touch) based drag and drop operations. It changes some default behaviours (for the better).
- When an element is being dragged outside of any dnd zone, the placeholder element now appears in the original dnd zone in the original index and indicates where the element would land if dropped. This was added for better UX and to address single sortable list use cases.
- This change includes the introduction of two new triggers, that can be intercepted by the
considerhandler:DRAGGED_LEFT_ALLwhich fires when the placeholder is added to the origin dndzone, andDRAGGED_ENTERED_ANOTHERwhich fires when the placeholder is removed from the origin dnd zone. - When drag starts - the library now locks the minimum width and height of the origin dropzone for the duration of the drag operation. This is done in order to prevent the container from shrinking and growing jarringly as the element is dragged around. This is especially helpful when the user drags the last element, which in previous versions could make the dndzone shrink underneath such that the dragged element wasn’t over it anymore.