2

I have a <lightning-combo-box> component.

The component shows the default values that I define and lists all of the options that I have given it.

The issue is, when selecting an option from the list, the value of the combo box is set to "please select an option" and none of the options are selectable.

The options are defined as:

@track options = [
    {Label:'Arizona', value:0},
    {Label:'Texas', value:1}
];
2

Apparently the value attribute of an option cannot be an integer. Changing the data to show like below works:

@track options = [
    {Label:'Arizona', value:'Arizona'},
    {Label:'Texas', value:'Texas'}
];
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.