Magicsuggest / magicsuggest

Multiple Selection Combo Box using Bootstrap 3
nicolasbize.com/magicsuggest/
1.3k stars 269 forks source link

Bug in clear() method #356

Open marcioamr opened 9 months ago

marcioamr commented 9 months ago

Is this project no longer maintained? Has it been replaced by another?

The clear() method does not work when using dynamic JSON and you define a custom valueField. The _selection object uses the value attribute instead of the specified valueField, and therefore cannot be found for clearing.

Can someone help me?

zergioz commented 6 months ago

Can you provide a code to look into it?

this.clear = function (isSilent) {
            this.removeFromSelection(_selection.slice(0), isSilent); // clone array to avoid concurrency issues
        };