Skip to content

Latest commit

 

History

History
250 lines (133 loc) · 12.2 KB

release-notes.md

File metadata and controls

250 lines (133 loc) · 12.2 KB

Svelte Dnd Action - Release Notes

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

Added the option to disable the final drop animation

Fixed a bug where library would crash when a store updated "considers" in local storage from another tab

Fixed a bug where library would crash if one of the canvas had an empty size

Fixed a bug where the scroller would stay active and scroll the page after drop

Added examples to the README (for the drag handles wrapper actions).

Added two wrapper actions (dragHandleZone and dragHandle) to make using drag handle easy.

Bug fix - calling transformDraggedElement after the element was morphed so that changes transform makes aren't overridden by the morphing.

Allows Svelte 5.0.0-next as peer dependency.

Fixes an issue on some touch devices, where attempting to drag an item causes the page to scroll.

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).

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.

Added custom events typings with generics to support TypeScript out of the box.

Updated README to help set up sveltekit + typescript

Added fault tolerance for use cases in which the user removes the shadow item from the list (e.g zones with limited slots)

Added support for class instances as list items

Added import and require to the export block in package.json so that types are properly resolved.

Added an export block to package.json to remove a Svelte 5 (actually vite) warning about the deprecated "svelte" entry

Don't use this version please. It has a silly mistake that cause an error with Sveltekit 2

bugfix - now works properly inside a <dialog> element

Fixed canvas content not getting cloned on dragged node.

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

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.

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).

A revert of the problematic part in 0.9.27. This version is functionally equal to 0.9.26

PLEASE DON'T USE THIS VERSION An unsuccessful attempt to support for dropzone being added mid-drag. It breaks in nested scenarios.

Readme typo fix in an example: setFeatueFlag -> setFeatureFlag

Made the fix that was introduced in version 0.9.23 available via feature flag but inactive by default

Updated readme with Svelte 4 types configuration

Fix morphing when within css grid

Fix repl examples in Readme. Add svelte >=3.23.0 as peerDependency

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)

update README to fix global.d.ts example

enhancement: DndEvent now allows the use of generics.

fix: if a drop zone is removed mid-drag it was causing the lib to throw errors

fix: dropdowns (select elements) will now maintain their value during drag

fixed a bug that made dropTargetClasses and dropTarget styles work incorrectly when applied to nested zones

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

fixed an issue with items sometimes not making way for the dragged element after autoscroll

fixed the typescript type for dropTargetClasses

added a link example for a basic implementation of multi-drag in the README

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

bugfix - works properly when under shadow dom

bugfix - works properly now when dropFromOtherDisabled is set to true while the shadow element is in the zone

added a new option, morphDisabled, that allows to disable morphing of dragged item.

bug fix - not crashing when a new dnd zone is created mid drag

exporting DRAGGED_ELEMENT_ID to allow targeting the dragged element and its subtree using CSS or to fetch it with document.getElementById.

fixed a race condition that could happen under extremely rapid drag-start -> drop while spam-clicking feverishly

exporting SHADOW_PLACEHOLDER_ITEM_ID for easier filtering in recursive zones use-cases

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.

fixed an issue when dragging an item on top of a droppedFromItemsDisabled zone (it is treated as outside of any now, as it should)

fixed a keyboard related bug - it is now possible to tab back to the dragged item after tabbing to external elements mid drag

accessibility features now work when the library is dynamically imported (in other words, keyboard navigation now works in the REPL again).

Made dropTargetClasses when initiating drag via keyboard.

Added a new option, dropTargetClasses, that allows adding global classes to a dnd-zone when it is a potential drop target (during drag).

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.

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 consider handler: DRAGGED_LEFT_ALL which fires when the placeholder is added to the origin dndzone, and DRAGGED_ENTERED_ANOTHER which 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.