Skip to content

feat(material-experimental/mdc-chips): Allow custom role for chip set #20829

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 3, 2020

Conversation

vanessanschmitt
Copy link
Collaborator

The default mat-chip-set role is 'presentation' if chips are
present, and null if there are no chips. Some users want to
specify custom roles, in particular 'list' (they would use
'listitem' for the chips, which have no default role).
Currently this isn't possible, because mat-chip-set overwrites
their custom role with 'presentation'. Add an Input to allow a
custom role.

@google-cla google-cla bot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Oct 19, 2020
The default mat-chip-set role is 'presentation' if chips are
present, and null if there are no chips. Some users want to
specify custom roles, in particular 'list' (they would use
'listitem' for the chips, which have no default role).
Currently this isn't possible, because mat-chip-set overwrites
their custom role with 'presentation'. Add an Input to allow a
custom role.
@zelliott
Copy link
Collaborator

What's the reason this shouldn't be hardcoded as list/listitem?

@vanessanschmitt
Copy link
Collaborator Author

What's the reason this shouldn't be hardcoded as list/listitem?

I considered that, and I don't think it's a bad idea! This PR doesn't preclude us from changing the default role in the future, and even if we decide to do so, I still think it would be nice to provide a way to override it. There are a few internal examples of people using mat-chip-set in a non-list/listitem way, and the original design intended for this component to be pretty generic/non-prescriptive.

@vanessanschmitt
Copy link
Collaborator Author

I don't think the failing ci/circleci: tests_saucelabs tests are related to this change. It looks like they're timing out.

Copy link
Contributor

@mmalerba mmalerba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mmalerba mmalerba added action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release labels Oct 28, 2020
@annieyw annieyw merged commit 335fc0c into angular:master Nov 3, 2020
annieyw pushed a commit that referenced this pull request Nov 3, 2020
…20829)

The default mat-chip-set role is 'presentation' if chips are
present, and null if there are no chips. Some users want to
specify custom roles, in particular 'list' (they would use
'listitem' for the chips, which have no default role).
Currently this isn't possible, because mat-chip-set overwrites
their custom role with 'presentation'. Add an Input to allow a
custom role.

(cherry picked from commit 335fc0c)
annieyw pushed a commit that referenced this pull request Nov 3, 2020
…20829)

The default mat-chip-set role is 'presentation' if chips are
present, and null if there are no chips. Some users want to
specify custom roles, in particular 'list' (they would use
'listitem' for the chips, which have no default role).
Currently this isn't possible, because mat-chip-set overwrites
their custom role with 'presentation'. Add an Input to allow a
custom role.

(cherry picked from commit 335fc0c)
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Dec 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants