Skip to content

Select component defaults to 'Choose ...' when selected option is 0 #35

@brunoimbrizi

Description

@brunoimbrizi

Consider the example:

var obj = {
    select : ['Hello','you','may','choose','one','of','these','options']
};
var controlKit = new ControlKit();
controlKit.addPanel().addSelect(obj,'select',{
    selected : 2,
    onChange : function(index){
        console.log(index);
    }
});

This renders the component with the correct option 'may' pre-selected.

However, updating the selected property to:

    selected: 0

Results in the component being rendered with the default 'Choose ...' option.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions