Skip to content

Commit

Permalink
[2683] Hide diagram element palette when the element itself is moved
Browse files Browse the repository at this point in the history
Bug: #2683
Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
  • Loading branch information
pcdavid committed Nov 30, 2023
1 parent f6f3505 commit 63fa976
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.adoc
Expand Up @@ -128,6 +128,7 @@ It uses our algorithm instead of elk.js to perform the arrange-all.
- https://github.com/eclipse-sirius/sirius-web/issues/2640[#2640] [diagram] Compute the handle position on diagram conversion, which happens every time a diagram refresh payload is received.
- https://github.com/eclipse-sirius/sirius-web/issues/2647[#2647] [diagram] Split border shorthand CSS properties into non-shorthand properties for list nodes.
Make some border node transparent when the node is in a list node in the convert engine.
- https://github.com/eclipse-sirius/sirius-web/issues/2683[#2683] [diagram] Hide diagram element palette when the element itself is moved.

=== New Features

Expand Down
Expand Up @@ -112,6 +112,7 @@ export const DiagramRenderer = ({ diagramRefreshedEventPayload, selection, setSe
setNodes(laidOutDiagram.nodes);
setEdges(laidOutDiagram.edges);
hideDiagramPalette();
hideDiagramElementPalette();
resetReferencePosition();
fitToScreen();

Expand All @@ -128,6 +129,10 @@ export const DiagramRenderer = ({ diagramRefreshedEventPayload, selection, setSe
const handleNodesChange: OnNodesChange = (changes: NodeChange[]) => {
const transformedNodeChanges = transformBorderNodeChanges(changes);

if (transformedNodeChanges.some((change) => change.type === 'position' || change.type === 'dimensions')) {
hideDiagramElementPalette();
}

let newNodes = applyNodeChanges(transformedNodeChanges, nodes);

newNodes = applyHandleChange(transformedNodeChanges, newNodes as Node<NodeData, DiagramNodeType>[]);
Expand Down

0 comments on commit 63fa976

Please sign in to comment.