rapsacnz/AuraMultiSelect

Getting issue on selecting multiple values (Shift+Click)

Vickal opened this issue · 3 comments

I'm getting below message in pop up on selection of multiple option from dropdown.
This page has an error. You might just need to refresh it.
Action failed: c:MultiSelect$controller$handleSelection [values is not defined]
Failing descriptor: {c:MultiSelect$controller$handleSelection}

Hi Vickal,
In the helper, there is a method setInfoText, now look at the else If condition.
`setInfoText: function(component, labels) {

    if (labels.length == 0) {
        component.set("v.infoText", "Select an option...");
    }
    if (labels.length == 1) {
        component.set("v.infoText", labels[0]);
    }
    else if (values.length > 1) { //this should be else if (labels.length > 1) {
        component.set("v.infoText", labels.length + " options selected");
    }
},`

@LuciferDoCode Just replace "values.length" in 3rd condition to "labels.length"