Issue
Giving the default behavior, when value is selected from a dropdown, MatChip appears within the input, but also expands it. I am a bit surprised this is the default behavior. Anyone can suggest how they fix it? Providing a forked StackBlitz demo (source take from Angular Material documentation):
You can see in the images bellow - when chip selected, input becomes taller.
Solution
Problem
The problem is mat-form-field-infix
class. When there are chips in the input, they increase the height.
Solution
You can set the minimal height for that class to be the same as when there are chips in the input. You can do it in the CSS file like this:
::ng-deep .mat-form-field-infix {
min-height: 32px;
}
Answered By - NeNaD
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.