Skip to content

Commit

Permalink
Correct Grid Column Gap Indicator Position (#6592)
Browse files Browse the repository at this point in the history
- Apply the same positioning for column gaps as was implemented for row
gaps.
  • Loading branch information
seanparsons authored Oct 28, 2024
1 parent ac18c51 commit 55ab421
Showing 1 changed file with 7 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -421,26 +421,21 @@ export function GridGapHandle({
[onHandleHoverStartInner, index],
)

const rowGapStyles =
axis === 'row'
? ({
left: '50%',
top: '50%',
transform: 'translate(-50%, -50%)',
position: 'absolute',
gridArea: `1/${index + 1}/2/${index + 2}`,
} as const)
: {}
return (
<div
data-testid={`${GridGapControlHandleTestId}-${gapId}`}
data-testid={`${GridGapControlHandleTestId}-${gapId}-${index}`}
style={{
visibility: shouldShowHandle ? 'visible' : 'hidden',
pointerEvents: 'all',
padding: hitAreaPadding,
cursor: axis === 'row' ? CSSCursor.GapNS : CSSCursor.GapEW,
opacity: handleOpacity,
...rowGapStyles,
left: '50%',
top: '50%',
transform: 'translate(-50%, -50%)',
position: 'absolute',
gridArea:
axis === 'row' ? `1/${index + 1}/2/${index + 2}` : `${index + 1}/1/${index + 2}/2`,
}}
onMouseDown={onMouseDown}
onMouseEnter={onHandleHoverStart}
Expand Down

0 comments on commit 55ab421

Please sign in to comment.