Skip to content

Commit

Permalink
Fix active grid cell border during move (#6356)
Browse files Browse the repository at this point in the history
**Problem:**

The new active cell indicator style introduce in
#6301 doesn't correctly
show the active cell borders.

**Fix:**

Fix that.

| Before | After |
|-------------|-----------|
| ![Kapture 2024-09-12 at 13 38
42](https://github.com/user-attachments/assets/c040c735-85b9-477e-9390-501536ed531d)
| ![Kapture 2024-09-12 at 13 39
10](https://github.com/user-attachments/assets/78820b33-0d11-414c-96a9-3dd8eb2ec3c9)
|
  • Loading branch information
ruggi authored Sep 12, 2024
1 parent b142af6 commit 22bd073
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions editor/src/components/canvas/controls/grid-controls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -815,11 +815,13 @@ export const GridControls = controlForStrategyMemoized<GridControlsProps>(({ tar
? features.Grid.dotgridColor
: 'transparent'

const borderColor =
const isActiveCell =
countedColumn === currentHoveredCell?.column &&
countedRow === currentHoveredCell?.row
? colorTheme.brandNeonPink.value
: features.Grid.inactiveGridColor

const borderColor = isActiveCell
? colorTheme.brandNeonPink.value
: features.Grid.inactiveGridColor

return (
<div
Expand All @@ -830,10 +832,13 @@ export const GridControls = controlForStrategyMemoized<GridControlsProps>(({ tar
borderTop: gridPlaceholderBorder(borderColor),
borderLeft: gridPlaceholderBorder(borderColor),
borderBottom:
countedRow >= grid.rows || (grid.rowGap != null && grid.rowGap > 0)
isActiveCell ||
countedRow >= grid.rows ||
(grid.rowGap != null && grid.rowGap > 0)
? gridPlaceholderBorder(borderColor)
: undefined,
borderRight:
isActiveCell ||
countedColumn >= grid.columns ||
(grid.columnGap != null && grid.columnGap > 0)
? gridPlaceholderBorder(borderColor)
Expand Down

0 comments on commit 22bd073

Please sign in to comment.