Selectr icon indicating copy to clipboard operation
Selectr copied to clipboard

defaultSelected false appears not to be working

Open YourMark opened this issue 6 years ago • 1 comments

It appears as though the defaultSelected option is not working. I am using this code: ` const packagingSelectr = new Selectr(packaging, { multiple: true, placeholder: 'Select a packaging', defaultSelected: false, clearable: true });

    console.log(packagingSelectr.getValue());

    packagingSelectr.on('selectr.change', function() {
        console.log(packagingSelectr.getValue());
        console.log(packagingSelectr);
    });

`

But the value always contains the first option as a value too. I can even select it 'twice'. It will never disappear from the selected options.

This looks like a bug to me.

For now I've fixed it by using: packagingSelectr.selectedValues = [];

YourMark avatar Nov 26 '18 13:11 YourMark

Update: It appears this is only failing on multiple selects

YourMark avatar Nov 26 '18 14:11 YourMark