This is related to the question at ng-select - Change height . I want to do the exact same but with a ng-select that enables multiple items to be selected.
Here is my code of the ng-select:
<label class="col-sm-4 text-sm-right col-form-label">Payout Format</label>
<div class="col-sm-8">
<ng-select
[items]="payoutFormats"
[multiple]="true"
[closeOnSelect]="true"
[searchable]="true"
bindValue="payoutBatchFormatID"
bindLabel="name"
placeholder="All"
[(ngModel)]="filter.payoutFormats"
name="payoutFormats">
</ng-select>
</div>
In my component I have added the following styles:
@Component({
templateUrl: './test.component.html',
styles: [`
.ng-select{
font-size:0.85em;
}
.ng-select .ng-select-container {
min-height: 3px;
}
.ng-select.ng-select-multiple .ng-select-container {
height: 3px;
}
`],
})
I was able to get this working with a non multiple select box by using
.ng-select.ng-select-single .ng-select-container {
height: 20px;
}
But changing it from .ng-select.ng-select-single to .ng-select.ng-select-multiple when multiple is enabled has no effect on the height.
Here is how my select looks like after the CSS:
I need it to be smaller.
UPDATE
In dev tools I can change min-height in .ng-select .ng-select-container as follows:
And my select box appears smaller:
However adding the same style to my component styling does not pick this up:
@Component({
templateUrl: './list-exceptions-handling-payments.component.html',
styles: [`
.ng-select{
font-size:0.85em;
}
.ng-select .ng-select-container{
min-height: 3px;
}
.ng-select.ng-select-multiple .ng-select-container {
height: 3px;
}
`],
})