akveo / nebular

:boom: Customizable Angular UI Library based on Eva Design System :new_moon_with_face::sparkles:Dark Mode
https://akveo.github.io/nebular
MIT License
8.05k stars 1.51k forks source link

Select collapses when size is set but no value is selected #2265

Open dawidjk opened 4 years ago

dawidjk commented 4 years ago

Issue type

I'm submitting a ... (check one with "x")

Issue description

Current behavior: When setting a size for a select with no value selected

<nb-select [size]="tiny" placeholder="placeholder"></nb-select>

the select component collapses to height=0. This does not happen when not setting the [size] property

Expected behavior: When setting the size and no value is selected, the select should not collapse

Steps to reproduce: This will display the placeholder

<nb-select placeholder="placeholder"></nb-select>

This collapses down

<nb-select [size]="tiny" placeholder="placeholder"></nb-select>

Related code:

insert short code snippets here

Other information:

node: v12.16.1 npm: 6.13.4 ngx-admin 4.0.1 angular: 8 nebular 4.6.0 Windows 10, Chrome

yggg commented 4 years ago

Do you have the tiny property in the component class? Square brackets binding expects expression as a value and if you don't have the tiny property, size value evaluates to undefined and no size set.

Try to remove square brackets around the size binding to make it size="tiny" or keep brackets and surround tiny with quotes ([size]="'tiny'").