-
Couldn't load subscription status.
- Fork 6.8k
Closed
Labels
P4A relatively minor issue that is not relevant to core functionsA relatively minor issue that is not relevant to core functionsarea: material/chips
Description
Is this a regression?
- Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
No response
Description
matChipRemove does not preventDefault(), allowing standard click behavior like following a parent hyperlink to trigger. matChipRemove does stopPropagation() though.
Reproduction
Steps to reproduce: https://stackblitz.com/edit/components-issue-va7p6c?file=src%2Fapp%2Fexample-component.html
<mat-chip-list>
<a href="https://example.org">
<mat-chip>example.org <mat-icon matChipRemove>close</mat-icon></mat-chip>
</a>
</mat-chip-list>Expected Behavior
Clicking on matChipRemove should fully consume the event, including preventDefault().
Actual Behavior
Clicking on matChipRemove triggers the parent hyperlink.
Environment
- Angular: 12.2.9
- CDK/Material: 12.2.9
- Browser(s): Chrome 98
- Operating System (e.g. Windows, macOS, Ubuntu): macOS 12.2
Metadata
Metadata
Assignees
Labels
P4A relatively minor issue that is not relevant to core functionsA relatively minor issue that is not relevant to core functionsarea: material/chips