Mobius1/Selectr

defaultSelected false appears not to be working

YourMark opened this issue · 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 = [];

Update: It appears this is only failing on multiple selects