Repository navigation
feat(draggable): align component with fusion designs - #8284
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Integrated handles override explicit vertical padding, unbatched reorders can lose or misdirect focus, and the Tile example lacks an accessible non-drag reorder path.
3 open issues
What changed in this PR
Aligns Carbon’s draggable components with Fusion designs and adds a shared integration for Cards, Tiles, and custom components.
Changes:
- Adds surface-matched drag ghosts, directional drop indicators, and handle-only dragging.
- Exposes
DragHandleanduseDraggableItemContext, including manual reordering, and deprecates Card’sdraggableprop. - Expands examples, accessibility guidance, generated references, and unit/browser coverage.
| File | Description |
|---|---|
src/components/tile/tile.test.tsx |
Tests handle integration and reorder-control slots. |
src/components/tile/tile.style.ts |
Adds draggable layout while preserving horizontal content. |
src/components/tile/tile.stories.tsx |
Adds a draggable Tile example. |
src/components/tile/tile.mdx |
Documents draggable Tiles and reorder controls. |
src/components/tile/tile.component.tsx |
Registers the surface and renders handles and controls. |
src/components/draggable/use-draggable-item-context.ts |
Exposes surface registration and manual reordering. |
src/components/draggable/index.ts |
Exports the public hook and handle APIs. |
src/components/draggable/draggable.test.tsx |
Tests ordering, registration, and component integration. |
src/components/draggable/draggable.stories.tsx |
Demonstrates Cards, Tiles, custom panels, and accessible controls. |
src/components/draggable/draggable.pw.tsx |
Covers browser dragging, geometry, keyboard controls, and focus. |
src/components/draggable/draggable.mdx |
Documents integration, accessibility, and testing. |
src/components/draggable/draggable-item/draggable-item.style.ts |
Styles ghosts, indicators, and shared handles. |
src/components/draggable/draggable-item/draggable-item.component.tsx |
Coordinates registered surfaces, handles, and item context. |
src/components/draggable/draggable-container.component.tsx |
Supports layout wrappers, shared ordering, and focus restoration. |
src/components/draggable/drag-handle/index.ts |
Exports the handle component and props. |
src/components/draggable/drag-handle/drag-handle.component.tsx |
Implements the reusable, context-registered handle. |
src/components/draggable/components.test-pw.tsx |
Adds browser-test fixtures for integrated components. |
src/components/draggable/__internal__/use-draggable-item.ts |
Encapsulates native drag registration and visual state. |
src/components/draggable/__internal__/drop-indicator.ts |
Calculates indicator direction and rounded-corner offsets. |
src/components/draggable/__internal__/drop-indicator.test.ts |
Tests indicator positioning and corner geometry. |
src/components/draggable/__internal__/draggable-item.context.ts |
Defines internal registration and reorder context. |
src/components/draggable/__internal__/drag-surface.ts |
Resolves surfaces and captures ghost geometry. |
src/components/draggable/__internal__/drag-surface.test.ts |
Tests surface selection and ghost dimensions. |
src/components/draggable/__internal__/data.ts |
Carries registered surfaces in drag data. |
src/components/card/card.test.tsx |
Updates the shared handle-style import. |
src/components/card/card.style.ts |
Centers drag-row controls and removes duplicate handle styling. |
src/components/card/card.mdx |
Documents automatic draggable integration. |
src/components/card/card.component.tsx |
Integrates the shared handle and deprecates draggable. |
skills/carbon-react/components/tile.md |
Updates generated Tile props and examples. |
skills/carbon-react/components/draggable-item.md |
Updates generated item API references. |
skills/carbon-react/components/draggable-container.md |
Updates generated container API references. |
skills/carbon-react/components/card.md |
Records the Card prop deprecation. |
Review effort: Balanced
491cd69 to
1d6fc78
Compare
1d6fc78 to
a0bea3d
Compare
|
Huge work you have out into this PR! Just a few small things to consider before wrapping it up:
|
DipperTheDan
left a comment
There was a problem hiding this comment.
Nothing more to add from me.
a0bea3d to
46e3784
Compare
|
Looks good to me. Might want to create a region internal to the |
|
Reviewed from a UX POV and LGTM. |
9a00fa3
3016171 to
cef0b5c
Compare
94e19e2
cef0b5c to
94e19e2
Compare
|
🎉 This PR is included in version 164.5.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |


Proposed behaviour
Updates component to support new fusion styling:
Surfaces new custom hook that allows any element to be passed into
DraggableItemand have theDragHandleand the accessible alternative callbacks etc. Deprecateddraggableprops in favour of this approachAdds examples of draggable
Tiles andCardsTablehas not been update as it relies on slightly different styling/behaviourCurrent behaviour
No support for ghost element when target is dragged
No drop target key line
No custom hook to support draggable custom elements
Checklist
d.tsfile added or updated if requiredQA
Additional context
Testing instructions