Skip to content

Nb-option with value of 0 is not being selected  #1971

Open
@shpongly

Description

@shpongly

HI,
I'm using reactive forms along with nb-select and nb-options that are being filled from a list. My list is:

tokenTypesList = [
{key:0, value: "aaa"},
{key:1, value: "bbb"},
{key:2, value: "ccc"}
]
this is how the select is defined in my html:

nb-select id="ddlTokenType" name="tokenType" [(ngModel)]="obj.TokenType" formControlName="tokenType" status="primary"><nb-option *ngFor="let tokenTypeItem of tokenTypesList" [value]="tokenTypeItem.key">
{{tokenTypeItem.value}}
<//nb-option><//nb-select>

on component init i'm loading an obj from db and attached it to the form. if the obj.TokenType is 0 then nothing is selected in the select. Any other values (i.e. 1 and 2 or even1234) are working as expected as I can see the value in the select.

Is this a bug? or maybe I'm doing somwthing wrong..

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions