fix(editor): clear wire selection before node drag
This commit is contained in:
parent
26b11a0203
commit
bcc9009278
|
|
@ -36,6 +36,7 @@ import {
|
|||
import { BlocksService } from "@services/blocks/blocks";
|
||||
import { ContainersService } from "@services/containers/containers";
|
||||
import { ResourcesService } from "@services/resources/resources";
|
||||
import { GraphSelectionService } from "@services/graph-selection/graph-selection";
|
||||
import { EditorStateHolder } from "@stores/flow-editor";
|
||||
import { ContainerNodeComponent } from "@shared/nodes/container-node/container-node";
|
||||
import { GenericNodeComponent } from "@shared/nodes/generic-node/generic-node";
|
||||
|
|
@ -107,6 +108,7 @@ export async function createEditor(
|
|||
const area = new AreaPlugin<HFSchemes, AreaExtra>(container);
|
||||
const connection = new ConnectionPlugin<HFSchemes, AreaExtra>();
|
||||
const render = new AngularPlugin<HFSchemes, AreaExtra>({ injector });
|
||||
const graphSelection = injector.get(GraphSelectionService);
|
||||
const nodeView = options?.nodeView ?? "editor";
|
||||
const readonly = options?.readonly === true;
|
||||
const programmaticTranslations = new Set<string>();
|
||||
|
|
@ -223,6 +225,9 @@ export async function createEditor(
|
|||
});
|
||||
|
||||
area.addPipe((context: any) => {
|
||||
// The connection renderer raises only the selected wire. A picked node is about to be dragged,
|
||||
// so clear that selection before its card can be drawn below the wire.
|
||||
if (context?.type === 'nodepicked') graphSelection.clearConnectionSelection();
|
||||
if (context?.type === 'nodetranslated') {
|
||||
// A loop follows only its own endpoints. A card merely crossed by the wire must not make the
|
||||
// wire move away, while moving either endpoint keeps the wire 48px above that endpoint.
|
||||
|
|
|
|||
Loading…
Reference in New Issue