Skip to content

fix: respect transition: null in framework bindings - #2131

Merged
clauderic merged 1 commit into
clauderic:mainfrom
NektarTheo:fix/sortable-transition-null
Sep 5, 2026
Merged

clauderic merged 1 commit into
clauderic:mainfrom
NektarTheo:fix/sortable-transition-null

Conversation

@NektarTheo

Copy link
Copy Markdown
Contributor

The React, Vue, Solid and Svelte bindings each merged defaultSortableTransition before constructing or updating the core Sortable, so an explicit transition: null was replaced by the default transition object and items kept animating. null is the documented and typed sentinel for disabling sortable transitions, and the core already supports it: the constructor default only applies to undefined, and Sortable.animate() returns early on a falsy transition.

Added a resolveSortableTransition helper to @dnd-kit/dom/sortable and used it in all four bindings, so that:

  • an omitted transition resolves to defaultSortableTransition
  • a partial transition merges with the defaults
  • an explicit null is preserved

The Disable transition story previously faked this with {duration: 0}; it now uses transition: null. The story id is unchanged.

Fixes #2077

The React, Vue, Solid and Svelte bindings each merged
`defaultSortableTransition` before constructing or updating the core
`Sortable`, so an explicit `transition: null` was replaced by the default
transition object and items kept animating. `null` is the documented and
typed sentinel for disabling sortable transitions, and the core already
supports it: the constructor default only applies to `undefined`, and
`Sortable.animate()` returns early on a falsy transition.

Add a `resolveSortableTransition` helper to `@dnd-kit/dom/sortable` and
use it in all four bindings, so that:

- an omitted transition resolves to `defaultSortableTransition`
- a partial transition merges with the defaults
- an explicit `null` is preserved

The `Disable transition` story previously faked this with
`{duration: 0}`; it now uses `transition: null`. The story id is
unchanged.

Fixes clauderic#2077

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Sep 1, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 037663b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 10 packages
Name Type
@dnd-kit/dom Patch
@dnd-kit/react Patch
@dnd-kit/vue Patch
@dnd-kit/solid Patch
@dnd-kit/svelte Patch
@dnd-kit/abstract Patch
@dnd-kit/collision Patch
@dnd-kit/geometry Patch
@dnd-kit/helpers Patch
@dnd-kit/state Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@NektarTheo NektarTheo changed the title fix(sortable): respect transition: null in framework bindings fix: respect transition: null in framework bindings Sep 1, 2026
@pkg-pr-new

pkg-pr-new Bot commented Sep 5, 2026

Copy link
Copy Markdown

Open in StackBlitz

@dnd-kit/abstract

npm i https://pkg.pr.new/@dnd-kit/abstract@2131

@dnd-kit/collision

npm i https://pkg.pr.new/@dnd-kit/collision@2131

@dnd-kit/dom

npm i https://pkg.pr.new/@dnd-kit/dom@2131

@dnd-kit/geometry

npm i https://pkg.pr.new/@dnd-kit/geometry@2131

@dnd-kit/helpers

npm i https://pkg.pr.new/@dnd-kit/helpers@2131

@dnd-kit/react

npm i https://pkg.pr.new/@dnd-kit/react@2131

@dnd-kit/solid

npm i https://pkg.pr.new/@dnd-kit/solid@2131

@dnd-kit/state

npm i https://pkg.pr.new/@dnd-kit/state@2131

@dnd-kit/svelte

npm i https://pkg.pr.new/@dnd-kit/svelte@2131

@dnd-kit/vue

npm i https://pkg.pr.new/@dnd-kit/vue@2131

commit: 037663b

@clauderic clauderic left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@clauderic
clauderic merged commit 8b9e1ad into clauderic:main Sep 5, 2026
8 of 9 checks passed
@github-actions github-actions Bot mentioned this pull request Sep 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sortable framework bindings ignore transition: null

2 participants