mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 10:31:15 +00:00
🐛 Fix issue that it starts select mode when mac users try to move workflow
This commit is contained in:
@@ -11,6 +11,11 @@ export const mouseSelect = mixins(nodeIndex).extend({
|
|||||||
selectBox: document.createElement('span'),
|
selectBox: document.createElement('span'),
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
isMacOs (): boolean {
|
||||||
|
return /(ipad|iphone|ipod|mac)/i.test(navigator.platform);
|
||||||
|
},
|
||||||
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
this.createSelectBox();
|
this.createSelectBox();
|
||||||
},
|
},
|
||||||
@@ -28,6 +33,12 @@ export const mouseSelect = mixins(nodeIndex).extend({
|
|||||||
// document.body.appendChild(this.selectBox);
|
// document.body.appendChild(this.selectBox);
|
||||||
this.$el.appendChild(this.selectBox);
|
this.$el.appendChild(this.selectBox);
|
||||||
},
|
},
|
||||||
|
isCtrlKeyPressed (e: MouseEvent | KeyboardEvent): boolean {
|
||||||
|
if (this.isMacOs) {
|
||||||
|
return e.metaKey;
|
||||||
|
}
|
||||||
|
return e.ctrlKey;
|
||||||
|
},
|
||||||
showSelectBox (event: MouseEvent) {
|
showSelectBox (event: MouseEvent) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
this.selectBox.x = event.pageX;
|
this.selectBox.x = event.pageX;
|
||||||
@@ -97,7 +108,7 @@ export const mouseSelect = mixins(nodeIndex).extend({
|
|||||||
return returnNodes;
|
return returnNodes;
|
||||||
},
|
},
|
||||||
mouseDownMouseSelect (e: MouseEvent) {
|
mouseDownMouseSelect (e: MouseEvent) {
|
||||||
if (e.ctrlKey === true) {
|
if (this.isCtrlKeyPressed(e) === true) {
|
||||||
// We only care about it when the ctrl key is not pressed at the same time.
|
// We only care about it when the ctrl key is not pressed at the same time.
|
||||||
// So we exit when it is pressed.
|
// So we exit when it is pressed.
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user