fix(userselection): dont unset selection on startup #515
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
* The user selection rectangle gets displayed when a user drags the mouse while pressing shift
|
||||
*/
|
||||
|
||||
import React, { memo, useEffect } from 'react';
|
||||
import React, { memo } from 'react';
|
||||
|
||||
import { useStoreActions, useStoreState } from '../../store/hooks';
|
||||
import { XYPosition } from '../../types';
|
||||
@@ -53,12 +53,6 @@ export default memo(({ selectionKeyPressed }: UserSelectionProps) => {
|
||||
const unsetUserSelection = useStoreActions((actions) => actions.unsetUserSelection);
|
||||
const renderUserSelectionPane = selectionActive || selectionKeyPressed;
|
||||
|
||||
useEffect(() => {
|
||||
if (!selectionKeyPressed) {
|
||||
unsetUserSelection();
|
||||
}
|
||||
}, [selectionKeyPressed]);
|
||||
|
||||
if (!elementsSelectable || !renderUserSelectionPane) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user