Skip to content

Commit 8b19fd9

Browse files
zarendcrisbeto
authored andcommitted
fix(material/chips): change div to span (#26343)
For `MatChip` component, change the `<div/>` element for the primary action to a span element. Fix problem where the div is nested inside a span. A span is a container for phrasing content and is not supposed to contain flow content. This could also potentialy cause accessibility issue. Correct the semantics by nesting a span inside another span. (cherry picked from commit 14919bd)
1 parent 3d7f63b commit 8b19fd9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/material/chips/chip.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
<span class="mat-mdc-chip-focus-overlay"></span>
66

77
<span class="mdc-evolution-chip__cell mdc-evolution-chip__cell--primary">
8-
<div matChipAction [isInteractive]="false">
8+
<span matChipAction [isInteractive]="false">
99
<span class="mdc-evolution-chip__graphic mat-mdc-chip-graphic" *ngIf="leadingIcon">
1010
<ng-content select="mat-chip-avatar, [matChipAvatar]"></ng-content>
1111
</span>
1212
<span class="mdc-evolution-chip__text-label mat-mdc-chip-action-label">
1313
<ng-content></ng-content>
1414
<span class="mat-mdc-chip-primary-focus-indicator mat-mdc-focus-indicator"></span>
1515
</span>
16-
</div>
16+
</span>
1717
</span>
1818

1919
<span

0 commit comments

Comments
 (0)