From 40b6fe7ff9832671792a499fed30f50ceef6552e Mon Sep 17 00:00:00 2001 From: Quincy Morgan Date: Fri, 10 Jan 2020 13:59:50 -0500 Subject: [PATCH] Fix semicombo drag-and-drop issues with stale data and target positioning (re: #7024) --- modules/ui/fields/combo.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/modules/ui/fields/combo.js b/modules/ui/fields/combo.js index c9222d210..467be7a7e 100644 --- a/modules/ui/fields/combo.js +++ b/modules/ui/fields/combo.js @@ -442,14 +442,15 @@ export function uiFieldCombo(field, context) { .attr('class', 'chip') .classed('draggable', isSemi); - if (isSemi) { // only semiCombo values are ordered - registerDragAndDrop(enter); - } - enter.append('span'); enter.append('a'); - chips = chips.merge(enter); + chips = chips.merge(enter) + .order(); + + if (isSemi) { // only semiCombo values are ordered + registerDragAndDrop(chips); + } chips.select('span') .text(function(d) { return d.value; }); @@ -521,8 +522,8 @@ export function uiFieldCombo(field, context) { // check the cursor is in the bounding box if ( index !== index2 && - d3_event.x < node.offsetLeft + (node.offsetWidth / 2) && - d3_event.x > node.offsetLeft - (node.offsetWidth / 2) && + d3_event.x < node.offsetLeft + node.offsetWidth + 5 && + d3_event.x > node.offsetLeft && d3_event.y < node.offsetTop + node.offsetHeight && d3_event.y > node.offsetTop ) {