Skip to content

Commit

Permalink
[3899] Fix nodesDraggable staying false
Browse files Browse the repository at this point in the history
Bug: #3899
Signed-off-by: Michaël Charfadi <[email protected]>
  • Loading branch information
mcharfadi committed Aug 28, 2024
1 parent db03783 commit 1abddb8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ As a result, the following maven modules have been deleted: `sirius-web-sample-a
- https://github.com/eclipse-sirius/sirius-web/issues/3851[#3851] [trees] Fix an issue where the tree filters menu items were not displayed anymore after a click on the filters menu.
- 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/3899[#3899] [diagram] Fix an issue when using alt-tab shortcut and trying to drag a node afterwards

=== New Features

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,15 @@ export const useNodesDraggable = (): UseNodesDraggableValue => {
};
document.addEventListener('keyup', keyupListener);

const onBlurListener = () => {
setState((prevState) => ({ ...prevState, nodesDraggable: true }));
};
document.addEventListener('blur', onBlurListener);

return () => {
document.removeEventListener('keydown', keydownListener);
document.removeEventListener('keyup', keyupListener);
document.removeEventListener('blur', onBlurListener);
};
}, []);

Expand Down

0 comments on commit 1abddb8

Please sign in to comment.