AndreyCurious opened a new issue, #2413: URL: https://github.com/apache/incubator-kie-issues/issues/2413
## Describe the bug In the new BPMN Editor, standard palette items register both `onDragStart` and `onDragEnd`. `onDragStart` creates a preview node (`newNodeProjection`) and `onDragEnd` clears it — including when the user cancels the drag (e.g. presses Esc, or releases outside a valid drop target). Custom task palette items (`CustomTasksPalette`) only receive `onDragStart`. `onDragEnd` is never wired to them, so when a custom-task drag ends without a successful drop, `newNodeProjection` is never cleared and a "ghost" node is left on the canvas (it can be moved around, but it does not exist in the model and cannot be reliably selected). Because it depends on how/when the drag ends, the issue is intermittent. ## Steps to reproduce 1. Open the BPMN Editor with at least one custom task available in the palette. 2. Open the "Custom tasks" palette group. 3. Start dragging a custom task onto the canvas, then cancel the drag (press Esc, or release outside a valid target). 4. A preview / "ghost" node remains on the canvas. 5. Dragging another node can then remove or interfere with the leftover ghost. ## Expected behavior Dragging a custom task should behave exactly like dragging a standard palette element: if the drag ends without a drop, the preview projection is cleared and no leftover node remains. ## Root cause `onDragEnd` (which clears `newNodeProjection`) is not passed to `CustomTasksPalette`, and `CustomTasksPalette` does not attach it to its draggable items — unlike every standard palette element in `BpmnPalette`. - `packages/bpmn-editor/src/diagram/BpmnPalette.tsx` — `onDragEnd` is defined and used by standard elements, but it is not passed to `<CustomTasksPalette>`. - `packages/bpmn-editor/src/customTasks/CustomTasksPalette.tsx` — no `onDragEnd` prop; the draggable item has only `onDragStart`. ## Suggested fix Pass `onDragEnd` to `CustomTasksPalette` and attach it to the draggable item, mirroring the standard palette elements. ## Environment - Apache KIE BPMN Editor (new editor), `main` - Reproduced on KIE Sandbox / local build -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
