diff --git a/editor/src/components/canvas/grid-panel.tsx b/editor/src/components/canvas/grid-panel.tsx index cc067e054fcc..91fa44f55be4 100644 --- a/editor/src/components/canvas/grid-panel.tsx +++ b/editor/src/components/canvas/grid-panel.tsx @@ -9,6 +9,8 @@ import { GridPanelHorizontalGapHalf, GridPanelVerticalGapHalf, } from './stored-layout' +import { useDispatch } from '../editor/store/dispatch-context' +import { clearHighlightedViews } from '../editor/actions/action-creators' interface GridPanelProps { onDrop: (itemToMove: StoredPanel, newPosition: LayoutUpdate) => void @@ -84,6 +86,12 @@ const GridPanelInner = React.memo((props) => { } })() + const dispatch = useDispatch() + + const onMouseEnter = React.useCallback(() => { + dispatch([clearHighlightedViews()], 'everyone') + }, [dispatch]) + return (
((props) => { paddingTop: GridPanelVerticalGapHalf, paddingBottom: GridPanelVerticalGapHalf, }} + onMouseEnter={onMouseEnter} > {draggablePanelComponent}