Skip to content

Commit

Permalink
Don't show siblings control for grid cells (#6252)
Browse files Browse the repository at this point in the history
  • Loading branch information
ruggi authored and liady committed Dec 13, 2024
1 parent 7d59c1f commit 0eaedaf
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,19 +175,24 @@ function convertToAbsoluteAndMoveStrategyFactory(setHuggingParentToFixed: SetHug
}
}

const autoLayoutSiblings = getAutoLayoutSiblings(
const autoLayoutSiblingsExceptGridCells = getAutoLayoutSiblings(
canvasState.startingMetadata,
canvasState.startingElementPathTree,
originalTargets,
).filter(
// don't show the siblings control for grid cells
(sibling) => !MetadataUtils.isGridCell(canvasState.startingMetadata, sibling.elementPath),
)
const hasAutoLayoutSiblings = autoLayoutSiblings.length > 1

const showSiblingsControl = autoLayoutSiblingsExceptGridCells.length > 1

const autoLayoutSiblingsBounds = getAutoLayoutSiblingsBounds(
canvasState.startingMetadata,
canvasState.startingElementPathTree,
originalTargets,
)

const autoLayoutSiblingsControl = hasAutoLayoutSiblings
const autoLayoutSiblingsControl = showSiblingsControl
? [
controlWithProps({
control: AutoLayoutSiblingsOutline,
Expand All @@ -200,7 +205,7 @@ function convertToAbsoluteAndMoveStrategyFactory(setHuggingParentToFixed: SetHug

const fitness = getFitness(
interactionSession,
hasAutoLayoutSiblings,
showSiblingsControl,
autoLayoutSiblingsBounds,
originalTargets.length > 1,
isPositionRelative,
Expand Down

0 comments on commit 0eaedaf

Please sign in to comment.