Skip to content

Commit ede34b1

Browse files
Ayush2k02Keavon
andauthored
Fix context menu blocking keyboard input after closing node graph (#3571)
* Fix context menu blocking keyboard input after closing node graph * Formatting * move context menu logic to Graph component * revert editior.svelte to original state * revert try 2 * fix import order issues * remove redundant paranthesis --------- Co-authored-by: Keavon Chambers <keavon@keavon.com>
1 parent 7a57907 commit ede34b1

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

frontend/src/components/views/Graph.svelte

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
66
import type { Editor } from "@graphite/editor";
77
import type { FrontendGraphInput, FrontendGraphOutput, FrontendNode } from "@graphite/messages";
8+
import type { DocumentState } from "@graphite/state-providers/document";
89
import type { NodeGraphState } from "@graphite/state-providers/node-graph";
910
1011
import NodeCatalog from "@graphite/components/floating-menus/NodeCatalog.svelte";
@@ -20,12 +21,16 @@
2021
2122
const editor = getContext<Editor>("editor");
2223
const nodeGraph = getContext<NodeGraphState>("nodeGraph");
24+
const document = getContext<DocumentState>("document");
2325
2426
let graph: HTMLDivElement | undefined;
2527
2628
$: gridSpacing = calculateGridSpacing($nodeGraph.transform.scale);
2729
$: gridDotRadius = 1 + Math.floor($nodeGraph.transform.scale - 0.5 + 0.001) / 2;
2830
31+
// Close the context menu when the graph view overlay is closed
32+
$: if (!$document.graphViewOverlayOpen) nodeGraph.closeContextMenu();
33+
2934
let inputElement: HTMLInputElement;
3035
let hoveringImportIndex: number | undefined = undefined;
3136
let hoveringExportIndex: number | undefined = undefined;

0 commit comments

Comments
 (0)