Skip to content

Commit

Permalink
Fix Absolute Resize Handle Priority (#6548)
Browse files Browse the repository at this point in the history
**Problem:**

![image](https://github.com/user-attachments/assets/aba59de0-34c6-4100-8863-8864b75c2546)

The absolute resize handle would be obscured by other canvas controls. 

The worst problem is that some invisible controls could also obscure it
and steal mouse events.

**Fix:**
- Setting the absolute resize handle to top priority.
- Taking away the top priority from `GridRowColumnResizingControls`
  • Loading branch information
balazsbajorics authored Oct 16, 2024
1 parent 7617ff1 commit e6dbbf8
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ export function absoluteResizeBoundingBoxStrategy(
props: { targets: originalTargets, pathsWereReplaced: pathsWereReplaced },
key: 'absolute-resize-control',
show: 'visible-except-when-other-strategy-is-active',
priority: 'top',
}),
controlWithProps({
control: ZeroSizeResizeControlWrapper,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ export function basicResizeStrategy(
props: { targets: selectedElements, pathsWereReplaced: false },
key: 'absolute-resize-control',
show: 'always-visible',
priority: 'top',
}),
controlWithProps({
control: ZeroSizeResizeControlWrapper,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ export function flexResizeBasicStrategy(
props: { targets: selectedElements, pathsWereReplaced: false },
key: 'absolute-resize-control',
show: 'always-visible',
priority: 'top',
}),
controlWithProps({
control: ZeroSizeResizeControlWrapper,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ export function flexResizeStrategy(
props: { targets: selectedElements, pathsWereReplaced: false },
key: 'absolute-resize-control',
show: 'always-visible',
priority: 'top',
}),
controlWithProps({
control: ZeroSizeResizeControlWrapper,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ export function keyboardAbsoluteResizeStrategy(
props: { targets: selectedElements, pathsWereReplaced: pathsWereReplaced },
key: 'absolute-resize-control',
show: 'visible-except-when-other-strategy-is-active',
priority: 'top',
}),
],
fitness: getFitness(interactionSession),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ export const resizeGridStrategy: CanvasStrategyFactory = (
props: { target: gridPath },
key: `grid-row-col-resize-controls-${EP.toString(gridPath)}`,
show: 'always-visible',
priority: 'top',
},
controlsForGridPlaceholders(gridPath),
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ Array [
"/UtopiaSpiedExoticType(Symbol(react.fragment))/UtopiaSpiedExoticType(Symbol(react.fragment))/GridMeasurementHelpers/Symbol(react.memo)()",
"/UtopiaSpiedExoticType(Symbol(react.fragment))/GridMeasurementHelpers//div",
"/null/Symbol(react.memo)()//Symbol(react.memo)()",
"/Symbol(react.memo)()///UtopiaSpiedExoticType(Symbol(react.fragment))",
"/null/Symbol(react.memo)()//Symbol(react.memo)()",
"/Symbol(react.memo)()///Symbol(react.memo)(Symbol(react.forward_ref)(ResizeEdge))",
"/Symbol(react.memo)()///Symbol(react.memo)(Symbol(react.forward_ref)(ResizeEdge))",
"/Symbol(react.memo)()///Symbol(react.memo)(Symbol(react.forward_ref)(ResizeEdge))",
Expand Down Expand Up @@ -88,8 +90,6 @@ Array [
"/div/Symbol(react.memo)(Symbol(react.forward_ref)(ResizePoint))/Symbol(react.forward_ref)(ResizePoint)/div",
"/div/Symbol(react.memo)(Symbol(react.forward_ref)(SizeLabel))/Symbol(react.forward_ref)(SizeLabel)/div:data-testid='SizeLabelTestId'",
"/div/Symbol(react.memo)(Symbol(react.forward_ref)(SizeLabel))/Symbol(react.forward_ref)(SizeLabel)/div:data-testid='parent-resize-label'",
"/null/Symbol(react.memo)()//Symbol(react.memo)()",
"/Symbol(react.memo)()///UtopiaSpiedExoticType(Symbol(react.fragment))",
"/Symbol(react.forward_ref)(Styled(div))/div/Symbol(react.forward_ref)(Styled(div))/div",
"/UtopiaSpiedFunctionComponent(SimpleFlexColumn)/div/ElementsOutsideVisibleAreaIndicator/Symbol(react.memo)(IndicatorArrow)",
"/div/div/NavigatorComponent/Symbol(react.memo)()",
Expand Down Expand Up @@ -842,6 +842,8 @@ Array [
"/UtopiaSpiedExoticType(Symbol(react.fragment))/UtopiaSpiedExoticType(Symbol(react.fragment))/GridMeasurementHelpers/Symbol(react.memo)()",
"/UtopiaSpiedExoticType(Symbol(react.fragment))/GridMeasurementHelpers//div",
"/null/Symbol(react.memo)()//Symbol(react.memo)()",
"/Symbol(react.memo)()///UtopiaSpiedExoticType(Symbol(react.fragment))",
"/null/Symbol(react.memo)()//Symbol(react.memo)()",
"/Symbol(react.memo)()///Symbol(react.memo)(Symbol(react.forward_ref)(ResizeEdge))",
"/Symbol(react.memo)()///Symbol(react.memo)(Symbol(react.forward_ref)(ResizeEdge))",
"/Symbol(react.memo)()///Symbol(react.memo)(Symbol(react.forward_ref)(ResizeEdge))",
Expand Down Expand Up @@ -872,8 +874,6 @@ Array [
"/div/Symbol(react.memo)(Symbol(react.forward_ref)(ResizePoint))/Symbol(react.forward_ref)(ResizePoint)/div",
"/div/Symbol(react.memo)(Symbol(react.forward_ref)(SizeLabel))/Symbol(react.forward_ref)(SizeLabel)/div:data-testid='SizeLabelTestId'",
"/div/Symbol(react.memo)(Symbol(react.forward_ref)(SizeLabel))/Symbol(react.forward_ref)(SizeLabel)/div:data-testid='parent-resize-label'",
"/null/Symbol(react.memo)()//Symbol(react.memo)()",
"/Symbol(react.memo)()///UtopiaSpiedExoticType(Symbol(react.fragment))",
"/Symbol(react.forward_ref)(Styled(div))/div/Symbol(react.forward_ref)(Styled(div))/div",
"/UtopiaSpiedFunctionComponent(SimpleFlexColumn)/div/ElementsOutsideVisibleAreaIndicator/Symbol(react.memo)(IndicatorArrow)",
"/div/div/NavigatorComponent/Symbol(react.memo)()",
Expand Down

0 comments on commit e6dbbf8

Please sign in to comment.