Skip to content

Commit 060ef43

Browse files
authored
Merge pull request #305 from eccenca/fix/disableHotKeysReactFlowV12-MT-44
Fix disable hotkey feature for react-flow V12 support
2 parents 2fbf113 + 10a42d3 commit 060ef43

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/cmem/react-flow/ReactFlow/ReactFlow.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React, {ReactElement, Ref} from "react";
22
import { KeyCode as KeyCodeV9 } from "react-flow-renderer";
33
import { KeyCode as KeyCodeV10 } from "react-flow-renderer-lts";
4+
import { KeyCode as KeyCodeV12} from "@xyflow/react";
45

56
import { CLASSPREFIX as eccgui } from "../../../configuration/constants";
67
import { ReactFlowMarkers } from "../../../extensions/react-flow/markers/ReactFlowMarkers";
@@ -165,7 +166,12 @@ const ReactFlowExtendedPlain = <T extends ReactFlowExtendedProps>({
165166
};
166167
break;
167168
case "v12":
168-
// FIXME: necessary for v12?
169+
keyCodeConfig = {
170+
selectionKeyCode: hotKeysDisabled ? null : (selectionKeyCode as KeyCodeV12),
171+
deleteKeyCode: hotKeysDisabled ? null : (deleteKeyCode as KeyCodeV12),
172+
multiSelectionKeyCode: hotKeysDisabled ? null : (multiSelectionKeyCode as KeyCodeV12),
173+
zoomActivationKeyCode: hotKeysDisabled ? null : (zoomActivationKeyCode as KeyCodeV12),
174+
};
169175
break;
170176
}
171177

0 commit comments

Comments
 (0)