-
Notifications
You must be signed in to change notification settings - Fork 3.4k
feat(contactChips): add basic support for md-separator-keys #8142
Conversation
Why was this closed? The previous PR (#6127) was skipped due to lacking unit tests. This PR includes tests and was ready to pull as far as I can see. |
This issue is closed as part of our ‘Surge Focus on Material 2' efforts. |
@Ignigena can you please rebase this? I would like to get it into 1.1.11 if possible. Thank you for your contribution! |
Add basic support for md-separator-keys. The ENTER and TAB keys trigger separation by default through md-autocomplete regardless of what additional key codes are user defined.
1562023
to
033fd96
Compare
@Splaktar wow, didn't expect this to ever get pushed through. I've rebased and should be more or less good to go. Let me know if anything needs to be adjusted since I haven't used Angular or Material in production since around the time of the "surge focus" that originally closed this. |
Thank you very much! I'll try to get the review done soon. Sorry for the many delays in getting this merged :) |
@Splaktar you are doing fantastic work on this project! |
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.
Initial review looks good, but it raised a few questions about differences between this and the md-chips
implementation that I want to verify with some manual testing.
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
Manual testing went well. I found some issues with existing documentation that I will open a separate PR for. |
using md-highlight-text on contact chips actually breaks the component only md-highlight-flags is supported on contact chips add md-highlight-flags example to mdHighlightDirective docs Relates to #8142
using md-highlight-text on contact chips actually breaks the component only md-highlight-flags is supported on contact chips add md-highlight-flags example to mdHighlightDirective docs Relates to #8142
} | ||
|
||
event.stopPropagation(); | ||
event.preventDefault(); |
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.
A component should only ever use preventDefault
or stopPropagation
when when it actually handles the specific key being pressed; this looks like it's doing it for every keypress into the chips component. This would result in blocking standard browser behaviors that people depend on.
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.
@jelbourn This should only be called if the specific keypress is mapped to a key code in the separatorKeys
configuration. Line 22 will immediately return if it's not a matching key so this should not run on every keypress.
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.
Ah, I misread that condition.
using md-highlight-text on contact chips actually breaks the component only md-highlight-flags is supported on contact chips add md-highlight-flags example to mdHighlightDirective docs Relates to #8142
Add basic support for md-separator-keys. The ENTER and TAB keys trigger separation by default through md-autocomplete regardless of what additional key codes are user defined.
using md-highlight-text on contact chips actually breaks the component only md-highlight-flags is supported on contact chips add md-highlight-flags example to mdHighlightDirective docs Relates to #8142
Add basic support for md-separator-keys. The ENTER and TAB keys trigger separation by default through md-autocomplete regardless of what additional key codes are user defined.
Add basic support for md-separator-keys. The ENTER and TAB keys trigger
separation by default through md-autocomplete regardless of what
additional key codes are user defined.
Implements #6097, continuation of #6127 with the addition of unit tests requested.