-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
feature(material-experimental/chips) Add grid keyboard shortcuts #16384
Conversation
related to #16173 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's my initial pass; I think I still have some details to look at more closely
* Example: | ||
* | ||
* `<mat-chip> | ||
* <mat-icon matChipRemove>cancel</mat-icon> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just noticed this example (copied from the old implementation) is wrong. The element should be a button.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The mat-icon element should be a button? This example matches the demo, which seems to work well: https://github.com/angular/components/blob/master/src/dev-app/chips/chips-demo.html#L47
I did put 'role': 'button' on the host element for matChipRemove:
https://github.com/angular/components/pull/16384/files#diff-350c9b188f681cf2a48614ce9b6a4cffR100
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding the role also works, it's just a style thing. We typically tell people to do
<button mat-icon-button aria-label="...">
<mat-icon>...</mat-icon>
</button>
rather than putting click handlers on icons directly; it's mostly about setting a good example
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense! The mdc classes right now don't play nicely with mat-icon-button. Can I fix this in a follow up PR? @jelbourn
Style question: What are the rules for prefixing private/internal variables and methods with _? |
bcb531f
to
05c9424
Compare
@jelbourn Just noting that I addressed the requested changes! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good, just one or two last nits
We use an underscore for any non-public member, which includes both real |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
No description provided.