github clauderic/dnd-kit @dnd-kit/dom@0.2.4

latest release: @dnd-kit/helpers@0.2.4
7 hours ago

Patch Changes

  • #1874 de27fbc Thanks @clauderic! - Expose ergonomic type aliases for drag and drop event handlers: CollisionEvent, BeforeDragStartEvent, DragStartEvent, DragMoveEvent, DragOverEvent, and DragEndEvent. These types are re-exported from @dnd-kit/dom and @dnd-kit/react for convenience.

  • #1854 c2097c9 Thanks @du33169! - Fixed Feedback plugin style injection in Shadow DOM (fix #1765)

  • #1875 6d80680 Thanks @clauderic! - Feedback plugin: Fix table cell width handling during drag operations. Use getBoundingClientRect().width instead of offsetWidth for sub-pixel precision, and restore original cell widths after dragging ends instead of leaving hardcoded values permanently.

  • #1877 0923bc6 Thanks @clauderic! - Respect prefers-reduced-motion media query across all animations. When the user prefers reduced motion, the following animations are disabled:

    • Keyboard drag move transitions (250ms translate)
    • Drop animation (250ms slide-back)
    • Sortable item swap transitions (250ms position shift)
  • #1876 5f1b19a Thanks @clauderic! - Refactor the Feedback plugin for improved modularity and extensibility.

    StyleSheetManager – Introduced a new generic CorePlugin that manages CSS stylesheet injection into document and shadow roots. Plugins can call register(cssRules) to declare styles and addRoot(root) to track additional roots. The manager reactively injects and cleans up adopted stylesheets as the drag operation's source and target roots change. The Feedback plugin now delegates all stylesheet management to the StyleSheetManager.

    Configurable drop animation – The Feedback plugin now accepts a dropAnimation option:

    • Pass { duration, easing } to customize the built-in animation timing
    • Pass a function for full custom animation control (receives context, return a promise)
    • Pass null to disable the drop animation entirely
    • Omit for the default 250ms ease animation

    Extracted helpers – Observer setup (createElementMutationObserver, createDocumentMutationObserver, createResizeObserver) and the drop animation logic (runDropAnimation) are now in dedicated modules within the feedback plugin directory.

  • Updated dependencies [de27fbc, 256432d, be7cfe3]:

    • @dnd-kit/abstract@0.2.4
    • @dnd-kit/collision@0.2.4
    • @dnd-kit/geometry@0.2.4
    • @dnd-kit/state@0.2.4

Don't miss a new dnd-kit release

NewReleases is sending notifications on new releases.