Skip to content

Commit a971aa6

Browse files
committed
fix: Focus ring issue
1 parent 0786d89 commit a971aa6

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

src/table/header-cell/styles.scss

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,16 +77,15 @@ $cell-horizontal-padding: awsui.$space-scaled-l;
7777
}
7878

7979
// Group header cells are sticky so the label stays visible while any child column
80-
// is on screen. JS applies clip-path imperatively on scroll to clip the right edge
81-
// as children scroll away — so the right border behaves naturally.
80+
// is on screen. JS applies max-width imperatively on scroll to clip the right edge
81+
// as children scroll away.
8282
// When sticky columns are active, JS also overrides inset-inline-start.
83+
// NOTE: overflow must NOT be set here — the resizer handle is absolutely positioned
84+
// and overflows the cell's right edge; clipping it would hide the resize handle.
8385
&-group {
8486
position: sticky;
8587
inset-inline-start: 0;
8688
z-index: 1;
87-
// overflow:hidden is required so that max-width constraint (applied imperatively on scroll)
88-
// clips the right border and content when children scroll out of view.
89-
overflow: hidden;
9089
}
9190

9291
// Hidden placeholder cells for grouped column headers.
@@ -95,11 +94,13 @@ $cell-horizontal-padding: awsui.$space-scaled-l;
9594
// is the table-level visibility prop (for the measurement thead), not our placeholder concept.
9695
&:has(.header-cell-hidden-content) {
9796
border-block-end-color: transparent;
97+
}
9898

99-
// Show focus ring on the th when the inner focusable div receives focus.
100-
&:focus-within {
101-
@include styles.focus-highlight(calc(-1 * #{awsui.$space-scaled-xxs}));
102-
}
99+
// Show focus ring on the th ONLY when the placeholder div itself is focused —
100+
// NOT when a descendant like the resizer button is focused.
101+
// :focus-within would be too broad and fires for the resizer button focus too.
102+
&:has(.header-cell-hidden-content:focus) {
103+
@include styles.focus-highlight(calc(-1 * #{awsui.$space-scaled-xxs}));
103104
}
104105

105106
// Divider styles for hidden placeholder cells (only when NOT the last cell in the row).

0 commit comments

Comments
 (0)