-
Notifications
You must be signed in to change notification settings - Fork 6.8k
bug(chips): fixes placeholder in chip inputs #7481 #7509
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
Conversation
src/lib/chips/chips.scss
Outdated
@@ -19,6 +19,16 @@ $mat-chip-input-margin: 3px; | |||
align-items: baseline; | |||
} | |||
|
|||
.mat-form-field-type-mat-chip-list { |
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.
should not be necessary, the user docs are apparently out of date, chips should be done like this now, which resolves the wrapping issues: http://plnkr.co/edit/kc3bxAZRgHS0JbGl3qSX?p=preview
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.
Done. Here is a PR to update that example too #7526
src/lib/chips/chip-list.ts
Outdated
@@ -240,7 +240,7 @@ export class MatChipList implements MatFormFieldControl<any>, ControlValueAccess | |||
} | |||
|
|||
get shouldPlaceholderFloat(): boolean { | |||
return this.empty; | |||
return !this.empty; |
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.
|| this.focused
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.
Done.
Can we also update any examples that still show the old way of doing it? Edit: oh nvm I see you put that in a separate PR |
@amcdnl Can you check out the CI failures? |
@kara - done :) |
@@ -353,9 +353,9 @@ describe('MatChipList', () => { | |||
|
|||
}); | |||
|
|||
it('should not float placeholder if no chip is selected', () => { | |||
it('should float placeholder if chip is selected', () => { |
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 think this was testing when there's a chip present but not selected, so it should still be "... if no chip is selected"
.
@tinayuangao Why was this expected to be not floating in the first place? It seems like we would want it to float even if the chip isn't selected, to avoid overlap.
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.
This test was invalid, it was expecting the inverse logic that was the bug before.
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.
agreed, but it was the "not float" part that was invalid not the "no chip is selected" part
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
Hi, has this fix made into any of the releases yet? I can't see it in the bug fixes listings for any release. I'm still on "@angular/material": "2.0.0-beta.12", which contains this bug. Thanks |
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. |
This PR resolves #7481 by: