angular / components

Component infrastructure and Material Design components for Angular
https://material.angular.io
MIT License
24.37k stars 6.75k forks source link

Allow custom roles for chip groups and chips #15787

Closed ienzam closed 2 years ago

ienzam commented 5 years ago

Please describe the feature you would like to request.

MatChipList and MatChip do not support providing role attribute. Add support for that.

What is the use-case or motivation for this proposal?

I want to use MatChipList and MatChip as radiobox and radio respectively for better accessibility support. But can't override.

Is there anything else we should know?

Should be a trivial change. I can send a PR.

ienzam commented 5 years ago

Current hack I am using:

/** Hack to override role of MatChipList which is not supported natively. */
@Directive({selector: 'mat-chip-list[role]'})
export class MatChipListRoleOverride {
  @Input() @HostBinding('attr.role') role?: string|null;
}

/** Hack to override role of MatChip which is not supported natively. */
@Directive({selector: 'gmat-suggestive-chip[role]'})
export class MatChipRoleOverride {
  @Input() @HostBinding('attr.role') role?: string|null;
}
jelbourn commented 3 years ago

This will be addressed with the MDC-based chips implementation, which has <mat-chip-set> and <mat-chip> without roles.

angular-robot[bot] commented 2 years ago

Just a heads up that we kicked off a community voting process for your feature request. There are 20 days until the voting process ends.

Find more details about Angular's feature request process in our documentation.

angular-automatic-lock-bot[bot] commented 2 years ago

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.