Repository navigation
Draggable, Sortable: fix errors and improve typing - #35481
EugeniyKiyashko merged 3 commits into
Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Event forwarding is malformed for sortable-to-draggable removals, and several callback payloads are incorrectly typed as never.
Review effort: Balanced
Findings: 1
Open (2)
What changed in this PR
Improves internal typing for Draggable and Sortable while preserving their drag-and-drop behavior.
Changes:
- Adds typed event, option, geometry, and helper interfaces.
- Replaces broad casts and dynamic calls with typed implementations.
- Uses typed internal utility imports.
| File | Description |
|---|---|
packages/devextreme/js/__internal/m_draggable.ts |
Adds generic properties and typed drag infrastructure. |
packages/devextreme/js/__internal/m_sortable.ts |
Adds concrete typing across sortable operations. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Note
Copilot was unable to run its full agentic suite in this review.
Copilot review overview
Review effort: Lite
Findings: 4
Open (8)
This is a runtime type mismatch, not just a TS typing issue:_fireRemoveEventis defined to… · New_keydownHandlernow requirese: DragEvent, but there is at least one call site that provides no… · New_keydownHandleris invoked without an event argument here, but it now assumeseis present and… · New Pass the underlying drag event instead of the event args wrapper Usingneverfor the handler argument makesDraggableBasePropertiesunusable for correctly-typed… · NewplaceholderClassNameis typed as requiredstring, but later code treats it as possibly… · NewcorrectedWidthcan be astring(including values like'100px'depending on upstream… · New Type drag callbacks with their actual event payloads
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
The extensive refactor touches core drag-and-drop event, scrolling, and DOM paths and warrants final human validation.
Review effort: Balanced
Findings: None
Resolved since last review (8)
_keydownHandleris invoked without an event argument here, but it now assumeseis present and…_keydownHandlernow requirese: DragEvent, but there is at least one call site that provides no… This is a runtime type mismatch, not just a TS typing issue:_fireRemoveEventis defined to… Pass the underlying drag event instead of the event args wrappercorrectedWidthcan be astring(including values like'100px'depending on upstream…placeholderClassNameis typed as requiredstring, but later code treats it as possibly… Usingneverfor the handler argument makesDraggableBasePropertiesunusable for correctly-typed… Type drag callbacks with their actual event payloads
…nd element shown handlers (DevExpress#5275)
25cc758 to
8f89606
Compare
| export type DragEventArgs = Cancelable & { | ||
| event: DragEvent; | ||
| itemData: unknown; | ||
| itemElement: unknown; |
There was a problem hiding this comment.
can we type it as dxElementWrapper, similar to DragStartArgs?
There was a problem hiding this comment.
will improve in the next PRs
| const clone = this.option('clone'); | ||
| const $container = this._getContainer(); | ||
| let template = this.option('dragTemplate'); | ||
| const dragTemplate = this.option('dragTemplate'); |
There was a problem hiding this comment.
| const dragTemplate = this.option('dragTemplate'); | |
| const { clone, dragTemplate } = this.option(); |
There was a problem hiding this comment.
will improve in the next PRs



No description provided.