Skip to content

Commit 14d896a

Browse files
authored
fix(material/sort): double focus indicators when strong focus is enabled (#33520)
Fixes that the sort header both its usual focus indicator and the strong focus one when strong focus is enabled. Fixes #33519.
1 parent c895595 commit 14d896a

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

‎src/material/core/focus-indicators/_private.scss‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ $default-border-radius: 4px;
6161
'mat-focus-indicator-border-radius': $border-radius,
6262
'mat-focus-indicator-border-color': $border-color,
6363
'mat-focus-indicator-display': $display,
64+
// This isn't used for styling the actual focus indicator, but can
65+
// be used to hide conflicting indicators when strong focus is enabled.
66+
'mat-focus-indicator-fallback-border-style': none,
6467
);
6568

6669
@if (&) {

‎src/material/sort/sort-header.scss‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ $fallbacks: m3-sort.get-tokens();
2525
// active, the arrow will always be shown so the user has no way of telling the difference.
2626
[mat-sort-header].cdk-keyboard-focused &,
2727
[mat-sort-header].cdk-program-focused & {
28-
border-bottom: solid 1px currentColor;
28+
border-bottom: var(--mat-focus-indicator-fallback-border-style, solid) 1px currentColor;
2929
}
3030

3131
// For the sort-header element, default inset/offset values are necessary to ensure that
3232
// the focus indicator is sufficiently contrastive and renders appropriately.
3333
&::before {
3434
$border-width: var(--mat-focus-indicator-border-width, #{private.$default-border-width});
35-
$offset: calc(#{$border-width} + 2px);
35+
$offset: calc(#{$border-width} + 4px);
3636
margin: calc(#{$offset} * -1);
3737
}
3838
}

0 commit comments

Comments
 (0)