Skip to content

Commit

Permalink
fix(gv-policy-studio): resolve drag and drop on FF linux
Browse files Browse the repository at this point in the history
  • Loading branch information
gcusnieux committed May 16, 2023
1 parent a70aec5 commit b8baf6e
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export class GvPolicyStudioMenu extends LitElement {
super();
this.selectedIds = [];
this.flowsTitle = 'Flows';
this._hasDragLock = false;
}

static get styles() {
Expand Down Expand Up @@ -319,6 +320,7 @@ export class GvPolicyStudioMenu extends LitElement {
}

_onDragStartPolicy(policy, e) {
this._hasDragLock = true;
e.dataTransfer.setData('text/plain', JSON.stringify({ policy }));
const size = 100;
this._draggablePolicyImage = appendDraggableImage(policy.icon, size);
Expand All @@ -327,6 +329,7 @@ export class GvPolicyStudioMenu extends LitElement {
}

_onDragEndPolicy() {
this._hasDragLock = false;
if (this._draggablePolicyImage) {
this._draggablePolicyImage.remove();
this._draggablePolicyImage = null;
Expand Down Expand Up @@ -363,7 +366,9 @@ export class GvPolicyStudioMenu extends LitElement {
}

_onMouseLeavePolicy() {
dispatchCustomEvent(this, 'target-policy', null);
if (this._hasDragLock === false) {
dispatchCustomEvent(this, 'target-policy', null);
}
}

_onMouseEnterFlow(e) {
Expand Down

0 comments on commit b8baf6e

Please sign in to comment.