Skip to content

Type="button" automatically set by matChipRemove directive #18464

Closed
@Guerric-P

Description

@Guerric-P

Reproduction

Steps to reproduce:

  1. Create a new project with a <mat-chip-list><mat-chip>Some text<mat-icon matChipRemove>cancel</mat-icon></mat-chip></mat-chip-list>
  2. Import bootstrap
  3. Start the application

Expected Behavior

I expect the close button to display properly, and I don't expect unrelated HTML attributes on the element.

Actual Behavior

The button displays with a square around it because matChipRemove directive applies a type="button" on the host element regardless of their tag name.

This renders a <mat-icon type="button"> which has no sense nor utility, and it displays with a square around it, because of this bootstrap CSS rule:

[type=button], [type=reset], [type=submit], button {
    -webkit-appearance: button;
}

Environment

  • Angular: 9
  • CDK/Material: 9
  • Browser(s): Chrome 79
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows 10

Related pull request: #18095

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions