All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[Unreleased]
[2.1.0] - 2026-10-13
The drag engine has been rewritten on Pointer Events with delegated document listeners. The x-drag-context / x-drag-item directives and the drag:end → orderedIds flow from 2.0 keep working; everything below is additive unless listed under Changed. See the upgrade guide for details.
Added
- Connected containers — contexts that share a group (
data-drag-group,{ group }, orx-drag-context.group.name) accept each other's items, including when a context is empty. A drop indicator shows where the item will land, anddata-drag-itemsmarks where items go in an empty context. - Mouse, pen, and touch support — touch drags start after a press-and-hold (
touchDelay, 200 ms by default); mouse drags start after a small movement (dragThreshold, 5 px by default). - Auto-scroll — scrolling ancestors and the page scroll while the pointer is near their edges (
autoScroll: { edge, speed }). - Nested contexts — reorderable columns that each hold a card list (kanban), with events never crossing between the levels.
- Keyboard moves between containers — Left/Right move a held item to the previous or next container in its group (skipping containers that refuse it); Up/Down/Home/End move within the list. Horizontal contexts swap the axes. Bindings can be changed with
configure( { keys } ). - Lifecycle events —
drag:start(cancelable),drag:over,drag:drop(cancelable before the DOM changes, withdetail.reject( message )),drag:cancel(with areason), anddrag:revert.drag:endnow reportsmoveId,itemId,group,fromContext,toContext,fromIndex,toIndex,fromOrderedIds, andtoOrderedIds. - Drop rules —
data-drag-disabled/{ disabled }and an{ accepts: ( detail ) => boolean }callback; refusing contexts getdata-drag-disallowedand drops on them are cancelled and announced. - Optimistic moves and revert — every move has a
moveId;LivewireDragAndDrop.revert( moveId ),LivewireDragAndDrop.revertItem( itemId ), and the$dragRevert( itemId )Alpine magic put an item back after a server rejection. - Translatable announcements — every screen reader message is a
{placeholder}template that can be set globally withLivewireDragAndDrop.configure( { messages } )or per context withdata-drag-messages. - Accessible names —
data-drag-labelon contexts and items feedsaria-labeland the{container}/{item}placeholders. LivewireDragAndDrop.configure()for messages, keys,dragThreshold,touchDelay, andautoScroll.- State attributes for styling —
data-dragging,data-drag-active,data-drag-disallowed,data-drag-over,body[data-drag-in-progress], and the--drag-indicator-colorcustom property. - Real-browser test suite — keyboard and mouse tests in headless Chrome (
npm run test:browser). - Release workflow — pushing a
v*tag tests, builds, publishes to npm with provenance, creates the GitHub release from this changelog, and imports the docs on docs.artisanpackui.dev. - New documentation pages: Connected Containers, Events and Lifecycle, Configuration and Translations, Styling, and Upgrading.
Changed
- Events no longer bubble. Listen on the
x-drag-contextelement itself rather than an ancestor,document, or a Livewire#[On]listener. This keeps nested contexts from receiving each other's events. - Native HTML5 drag-and-drop has been replaced with Pointer Events; items no longer get
draggable="true". aria-grabbed(deprecated in ARIA 1.1) is no longer set. Items getrole="button",tabindex="0", andaria-describedbypointing at usage instructions; contexts getrole="group". Author-provided attributes are never overwritten.- Arrow keys only move between containers for grouped contexts; ungrouped lists behave as before.
- After a keyboard drop, focus stays on the moved item, including after a Livewire morph replaces it.
- The package now works as an Alpine plugin (
Alpine.plugin( LivewireDragAndDrop )) and still registers itself automatically onalpine:init. - The repository, issues, and npm metadata now point at GitHub.
- The 2.0.1 named exports (
registerDirectives,registerLivewireHooks) are kept;registerDirectivesis now the same function as the default export. - The UMD build's
window.LivewireDragAndDropglobal is the plugin function (withconfigure,revert, and the rest of the API on it), not a module namespace object.
Fixed
- The Livewire integration now uses the
morphedhook (Livewire 3 and 4). The 2.0message.processedhook never fired, which left moved items permanently marked__livewire_ignoreso server re-renders no longer applied to them. - Pressing Escape, or moving focus away during a keyboard drag, now restores the item to its original container and position.
Removed
- The obsolete
.gitlab-ci.ymlpipeline.
[2.0.1] - 2025-12-05
Fixed
- Added missing default export to fix build errors when importing the package with default import syntax (
import LivewireDragAndDrop from "@artisanpack-ui/livewire-drag-and-drop"). The package now properly exports a default function for manual Alpine.js plugin registration. - Added named exports (
registerDirectives,registerLivewireHooks) for advanced usage scenarios requiring granular control over initialization.
Notes
- This fix is fully backward compatible. Existing applications using side-effect imports (
import "@artisanpack-ui/livewire-drag-and-drop") will continue working without any changes, as automatic registration viaalpine:initandlivewire:initevent listeners remains intact.
Props
@eyler
[2.0.0] - 2025-10-12
🚀 Major Architectural Rework for Stability
This release marks a significant milestone in the stability and reliability of the livewire-drag-and-drop package. While the public API (x-drag-context and x-drag-item directives) remains unchanged, the underlying JavaScript has been completely rewritten to be truly immune to Livewire's DOM morphing.
Fixed
- Corrected a fundamental race condition between Livewire's
message.processedhook and Alpine.js'sinitTreefunction, which caused existing draggable items to become unresponsive after a new item was added or deleted. - Resolved an issue where
draggable="true"attributes were not being reapplied to existing elements after a Livewire update.
Changed
- BREAKING CHANGE: The internal JavaScript architecture has been refactored. The event listener pattern is now stateless, and a manual
forceRehydrateDraggableItemsfunction has been introduced to ensure all items are correctly initialized after every Livewire update. While this doesn't change how you use the package, it's a fundamental shift from the flawed architecture of v1.0.0. All users are strongly encouraged to upgrade.
[1.0.0] - 2025-10-11
Added
- Initial release of ArtisanPack UI Livewire Drag and Drop package
- Accessibility-first drag-and-drop utility with WCAG 2.1 AA compliance
- Full keyboard navigation support with arrow keys, space/enter, and escape
- Screen reader support with comprehensive ARIA attributes
- Native Alpine.js integration with custom directives
- Livewire compatibility with custom events for backend integration
- Touch-friendly interface for desktop, tablet, and mobile devices
- Support for multiple use cases including lists, kanban boards, and complex drag-and-drop interfaces
- Comprehensive test suite including accessibility tests with jest-axe
- Complete documentation with usage examples and setup instructions
- ES Module and CDN distribution support

