mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-15 14:18:04 +08:00
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>
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
|
||||
import type { Editor } from "@graphite/editor";
|
||||
import type { FrontendGraphInput, FrontendGraphOutput, FrontendNode } from "@graphite/messages";
|
||||
import type { DocumentState } from "@graphite/state-providers/document";
|
||||
import type { NodeGraphState } from "@graphite/state-providers/node-graph";
|
||||
|
||||
import NodeCatalog from "@graphite/components/floating-menus/NodeCatalog.svelte";
|
||||
@@ -20,12 +21,16 @@
|
||||
|
||||
const editor = getContext<Editor>("editor");
|
||||
const nodeGraph = getContext<NodeGraphState>("nodeGraph");
|
||||
const document = getContext<DocumentState>("document");
|
||||
|
||||
let graph: HTMLDivElement | undefined;
|
||||
|
||||
$: gridSpacing = calculateGridSpacing($nodeGraph.transform.scale);
|
||||
$: gridDotRadius = 1 + Math.floor($nodeGraph.transform.scale - 0.5 + 0.001) / 2;
|
||||
|
||||
// Close the context menu when the graph view overlay is closed
|
||||
$: if (!$document.graphViewOverlayOpen) nodeGraph.closeContextMenu();
|
||||
|
||||
let inputElement: HTMLInputElement;
|
||||
let hoveringImportIndex: number | undefined = undefined;
|
||||
let hoveringExportIndex: number | undefined = undefined;
|
||||
|
||||
Reference in New Issue
Block a user