From 276b1a7d7da471fe6004b680f3f3bf8c43eaf7d0 Mon Sep 17 00:00:00 2001 From: benebsiny Date: Fri, 14 Jan 2022 13:42:46 +0800 Subject: [PATCH] [JENKINS-67496] Drag & drop is messed up, drag placeholders always have tiny size --- war/src/main/js/sortable-drag-drop.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/war/src/main/js/sortable-drag-drop.js b/war/src/main/js/sortable-drag-drop.js index 84217f3ce238..4130af451f91 100644 --- a/war/src/main/js/sortable-drag-drop.js +++ b/war/src/main/js/sortable-drag-drop.js @@ -23,6 +23,14 @@ function registerSortableDragDrop(e) { forceFallback: true, // Do not use html5 drag & drop behaviour because it does not work with autoscroll scroll: true, bubbleScroll: true, + onChoose: function (event) { + const draggableDiv = event.item; + const height = draggableDiv.clientHeight; + draggableDiv.style.height = `${height}px`; + }, + onUnchoose: function (event) { + event.item.style.removeProperty('height'); + } }); }