fix: Drawflows Lösch-"x" beim Rechtsklick unterdrücken
Rechts dient nur zum Verschieben von Knoten bzw. der Ansicht; das contextmenu-Event wird in der Capture-Phase gestoppt, bevor Drawflow den Lösch-Button am selektierten Knoten einblendet. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -379,7 +379,6 @@ function attach(host) {
|
||||
// Ansicht verschoben (Panning).
|
||||
let rightDrag = null;
|
||||
let rightPan = null;
|
||||
let suppressContextMenu = false;
|
||||
container.addEventListener('mousedown', e => {
|
||||
if (e.button !== 2) return;
|
||||
e.preventDefault();
|
||||
@@ -395,7 +394,6 @@ function attach(host) {
|
||||
} else {
|
||||
rightPan = { lastX: e.clientX, lastY: e.clientY };
|
||||
}
|
||||
suppressContextMenu = true;
|
||||
}, true);
|
||||
|
||||
const onRightMove = e => {
|
||||
@@ -424,13 +422,13 @@ function attach(host) {
|
||||
document.addEventListener('mousemove', onRightMove);
|
||||
document.addEventListener('mouseup', onRightUp);
|
||||
|
||||
// Browser-Kontextmenü nach Rechts-Ziehen (Knoten oder Canvas) unterdrücken.
|
||||
// Rechts dient nur zum Verschieben: Browser-Kontextmenü unterdrücken und
|
||||
// das Event in der Capture-Phase stoppen, bevor Drawflows eigener
|
||||
// contextmenu-Handler das Lösch-"x" am selektierten Knoten einblendet.
|
||||
container.addEventListener('contextmenu', e => {
|
||||
if (suppressContextMenu) {
|
||||
e.preventDefault();
|
||||
suppressContextMenu = false;
|
||||
}
|
||||
});
|
||||
e.stopPropagation();
|
||||
}, true);
|
||||
|
||||
// Zoomen mit dem Mausrad (ohne Strg). Läuft in der Capture-Phase und stoppt
|
||||
// die Propagation, damit Drawflows eigenes Strg+Rad-Zoom nicht zusätzlich
|
||||
|
||||
Reference in New Issue
Block a user