nebular icon indicating copy to clipboard operation
nebular copied to clipboard

NbSelect is empty on init (uses translate pipe from ngx-translate)

Open grizlizli opened this issue 2 years ago • 0 comments

NbSelect initial value not selected

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

  • [x] bug report
  • [ ] feature request

Issue description

Current behavior:

We use Nebular on our project. It's awesome. Keep up the good work.

However, we use NbSelect for the language options. On initial selected value ('en'), NbSelect is empty and kind of shrinked. Language options are array of strings (['en', 'es', ...]). If select is clicked and no option choosed, it is fixed. As far I can tell, translate pipe is causing the issue here. (nxg-translate)

Expected behavior:

Initial value to be selected.

Steps to reproduce:

Related code:

<nb-select
        shape="round"
        (selectedChange)="languageSelectionChange($event)"
        [selected]="currentLanguage"
      >
        <nb-option *ngFor="let language of languages" [value]="language">{{
          'languages.' + language | translate
        }}</nb-option>
      </nb-select>

Other information:

npm, node, OS, Browser

<!--
Node: 14.15.0, 
npm: 6.14.8,
Windows: 10,
Chrome: 105.0.5195.102
-->

language-empty language-selected

Angular, Nebular

<!--
Nebular: 9.1.0-rc.4,
Angular: 14.1.3
-->

grizlizli avatar Sep 14 '22 15:09 grizlizli