Multiselect protoUI selection bug

I encountered a bug while trying to extend the multiselect using protoui.

Here is a code that you can use to reproduce it:
https://snippet.webix.com/3ico4aii

// to reproduce the bug select both A and B, while they are both selected try to unselect one
// the new widget won’t unselect it, and will add a duplicated item instead
webix.protoUI({
 	name: "Foo",
	defaults: {
    	options:["A", "B"],
    }
},webix.ui.multiselect);

webix.ui({
    view: "Foo"
});

I also noted that if I define the options inside webix.ui (and not in the defaults) the code work as it should.

Hello @Luca0288 ,
This is actually not a bug. Typically, the defaults property should not be used to set any data-related properties, as it might cause some issues later on (like the one you’ve encountered). Usually, the defaults are used to set non-data related, static configuration settings. You could find more information in this article (Default settings).
To set a default set of options you could use $init handler instead: Code Snippet or define the options in your “Foo” instance config (inside webix.ui).