Skip to content

how to properly hide a diagram #1331

Answered by tortmayr
kchobantonov asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @kchobantonov,
sorry for the late reply. Somehow we missed this open question.

I tested this and in general GLSP/sprotty keylisteners are not registered if the diagram is not visible.
However, for the copy & paste functionality a different approach is used. Since SVG does not nativly support the copy event we have to register the copy/paste/cut event listeners on the window. That's why the also trigger if the diagram is hidden.

See https://github.com/eclipse-glsp/glsp-client/blob/09e87efc4f27b3c69a4868c4ee46a7fe1981857d/packages/client/src/features/copy-paste/copy-paste-standalone.ts#L48

That's definitly not ideal for scenarios where the diagram is nested into another application frame…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by kchobantonov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants