diff --git a/editor/src/components/canvas/controls/grid-controls.tsx b/editor/src/components/canvas/controls/grid-controls.tsx index 9f23bff592dd..89ae8fbed134 100644 --- a/editor/src/components/canvas/controls/grid-controls.tsx +++ b/editor/src/components/canvas/controls/grid-controls.tsx @@ -20,7 +20,7 @@ import { printGridCSSNumber, } from '../../../components/inspector/common/css-utils' import { MetadataUtils } from '../../../core/model/element-metadata-utils' -import { mapDropNulls, stripNulls } from '../../../core/shared/array-utils' +import { mapDropNulls, stripNulls, uniqBy } from '../../../core/shared/array-utils' import { defaultEither } from '../../../core/shared/either' import * as EP from '../../../core/shared/element-path' import type { @@ -1137,7 +1137,7 @@ export const GridControls = controlForStrategyMemoized(({ tar 'GridControls hoveredGrids', ) - const grids = useGridData([...targets, ...hoveredGrids]) + const grids = useGridData(uniqBy([...targets, ...hoveredGrids], (a, b) => EP.pathsEqual(a, b))) if (grids.length === 0) { return null