-
Notifications
You must be signed in to change notification settings - Fork 357
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
feat(chips): ability to disable chip addition (input). (closes #500) #547
Merged
Merged
Changes from 13 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
9b1fbd0
added chips
Josh-Schoen 1d19cde
added autocomplete boolean for chips component
Josh-Schoen 4c5d6ba
added autocomplete boolean for chips component
Josh-Schoen 43bb340
added comment description
Josh-Schoen bcb3145
added toogle autocomplete method for documentation and testing.
Josh-Schoen f55d200
Merge branch 'develop' into feature/chips
JoshSchoen fc1e306
removed white spaces
Josh-Schoen 61d029e
removed blank lines
Josh-Schoen fd1d598
Merge branch 'feature/chips' of github.com:JoshSchoen/covalent-1 into…
Josh-Schoen e5a3cf2
changed autoComplete to allowAdd to disable chips autocomplete
Josh-Schoen f13979a
changed comment from autoComplte to allowAdd
Josh-Schoen 296dd60
removed blank space
Josh-Schoen f9c8338
changed autocomplete click event from inlut.value to item, added chec…
Josh-Schoen b9e084e
Merge branch 'develop' into feature/chips
kyleledbetter d661d1a
added ngIf to .mat-input-underline
Josh-Schoen 4e1fe5a
Merge branch 'feature/chips' of github.com:JoshSchoen/covalent-1 into…
Josh-Schoen cfa7d62
changed allowAdd to chipAddition
Josh-Schoen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
There is a weird bug when you toggle the
allowAdd
to false and then back to true, once you focus theinput
the autocomplete doesnt appear until you type on it.The fix is to put the
md-autocomplete
out of the<div *ngIf="allowAdd">
so its added as soon as themd-input
is rendered without affecting the autocomplete rendering.e. g.
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.
When I move the
md-autocomplete
outside<div *ngIf="allowAdd">
it breaks the ability add chips, the input.value is undefined. One way to get around this to visually with CSS hide it rather than removing it from the DOM with *ngIf. Let me know if this is acceptable otherwise I can look into an alternative.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 alternative approach would be to change
(click)="addChip(input.value)
to(click)="addChip(item)
. I might be wrong but for the click event wouldn't this be a little more concise to match the available list if we are only allowing the items in the list array anyway? Of course the input is a different thing but I don't see any errors and the focus event works as excepted when toggling from false back to true.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.
Yeah, I think it should use
addChip(item)
either way to be more consistent.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.
cool thanks!