From 7d3e6d365396a29b33588b2a9075dbe968cad9e9 Mon Sep 17 00:00:00 2001 From: Oliver-Akins Date: Fri, 25 Jul 2025 22:00:56 -0600 Subject: [PATCH] Tweak what element is required to be used in order to drag an attribute --- module/apps/AttributeManager.mjs | 5 +++-- templates/AttributeManager/attribute-list.hbs | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/module/apps/AttributeManager.mjs b/module/apps/AttributeManager.mjs index 2029e0d..d677606 100644 --- a/module/apps/AttributeManager.mjs +++ b/module/apps/AttributeManager.mjs @@ -71,7 +71,7 @@ export class AttributeManager extends HandlebarsApplicationMixin(ApplicationV2) }; new DragDrop.implementation({ - dragSelector: `[data-attribute]`, + dragSelector: `.draggable`, permissions: { dragstart: this._canDragStart.bind(this), drop: this._canDragDrop.bind(this), @@ -194,7 +194,7 @@ export class AttributeManager extends HandlebarsApplicationMixin(ApplicationV2) }; _onDragStart(event) { - const target = event.currentTarget; + const target = event.currentTarget.closest(`[data-attribute]`); if (`link` in event.target.dataset) { return }; let dragData; @@ -208,6 +208,7 @@ export class AttributeManager extends HandlebarsApplicationMixin(ApplicationV2) }; if (!dragData) { return }; + event.dataTransfer.setDragImage(target, 16, 23); event.dataTransfer.setData(`text/plain`, JSON.stringify(dragData)); }; diff --git a/templates/AttributeManager/attribute-list.hbs b/templates/AttributeManager/attribute-list.hbs index 6bb3c33..5899acb 100644 --- a/templates/AttributeManager/attribute-list.hbs +++ b/templates/AttributeManager/attribute-list.hbs @@ -8,6 +8,7 @@ name="icons/drag-handle" var:stroke="currentColor" var:fill="currentColor" + class="draggable" > {{#if attr.isNew}}