Skip to content

Commit 6f6b6e7

Browse files
committed
fix(multi-sim): fix drag re-ordering UI
1 parent a0fdf1a commit 6f6b6e7

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/e3sm_compareview/components/simulation_selection.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111
dragged_simulation_path = entry.path;
1212
event.dataTransfer.effectAllowed = 'move';
1313
event.dataTransfer.setData('text/plain', entry.path);
14+
15+
const row = event.currentTarget && event.currentTarget.closest('.simulation-entry-row');
16+
if (row && event.dataTransfer && event.dataTransfer.setDragImage) {
17+
const rowRect = row.getBoundingClientRect();
18+
event.dataTransfer.setDragImage(row, 220, Math.round(rowRect.height / 2));
19+
}
1420
},
1521
dragend: () => {
1622
dragged_simulation_path = '';
@@ -119,7 +125,7 @@ def __init__(self):
119125
with html.Div(
120126
v_for="(entry, idx) in simulation_configs",
121127
key="`${entry.path}-card`",
122-
classes="pb-2 d-flex align-center",
128+
classes="simulation-entry-row pb-2 d-flex align-center",
123129
v_on=SIMULATION_DROP_EVENTS,
124130
):
125131
with html.Div(

0 commit comments

Comments
 (0)