Better selection usability (#4379)

* use pointer capture for selection boxes

* fixed selection box behaviour

* promoted modifier listeners to window level

* selection should still happen when shift key is let go during selection

* ported changes to svelte flow

* review changes
This commit is contained in:
Peter Kogo
2024-06-19 17:05:04 +02:00
committed by GitHub
parent 75acd24cee
commit 86438a954f
4 changed files with 67 additions and 40 deletions
@@ -26,7 +26,7 @@ export function useGlobalKeyHandler({
const { deleteElements } = useReactFlow();
const deleteKeyPressed = useKeyPress(deleteKeyCode, deleteKeyOptions);
const multiSelectionKeyPressed = useKeyPress(multiSelectionKeyCode);
const multiSelectionKeyPressed = useKeyPress(multiSelectionKeyCode, { target: window });
useEffect(() => {
if (deleteKeyPressed) {