diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 3d1d5fe3a7..232e1e3327 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -78,6 +78,7 @@ As a result, the following maven modules have been deleted: `sirius-web-sample-a - https://github.com/eclipse-sirius/sirius-web/issues/3849[#3849] [form] Fix the tree representation in form support the display of the same referenced element many times in the tree. - https://github.com/eclipse-sirius/sirius-web/issues/3878[#3878] [diagram] Unmount ReactFlowProvider after layout - https://github.com/eclipse-sirius/sirius-web/issues/3869[#3869] [form] Close form-based views when the underlying element no longer exists. +- https://github.com/eclipse-sirius/sirius-web/issues/3899[#3899] [diagram] Fix an issue when using alt-tab shortcut and trying to drag a node afterwards === New Features diff --git a/packages/diagrams/frontend/sirius-components-diagrams/src/renderer/drag/useNodesDraggable.ts b/packages/diagrams/frontend/sirius-components-diagrams/src/renderer/drag/useNodesDraggable.ts index 6c38cb3085..0e0f94338c 100644 --- a/packages/diagrams/frontend/sirius-components-diagrams/src/renderer/drag/useNodesDraggable.ts +++ b/packages/diagrams/frontend/sirius-components-diagrams/src/renderer/drag/useNodesDraggable.ts @@ -34,9 +34,15 @@ export const useNodesDraggable = (): UseNodesDraggableValue => { }; document.addEventListener('keyup', keyupListener); + const onBlurListener = () => { + setState((prevState) => ({ ...prevState, nodesDraggable: true })); + }; + window.addEventListener('blur', onBlurListener); + return () => { document.removeEventListener('keydown', keydownListener); document.removeEventListener('keyup', keyupListener); + window.removeEventListener('blur', onBlurListener); }; }, []);