[SalesForce] Not able to select multiple picklist values using lightning:select

Lightning Ui namespace is deprecating soon hence we are migrating Ui namespace tags to the lightning namespace. We have used the below tag to select multi picklist values with the Ui namespace. Now salesforce suggesting to use Use lightning:select or lightning:combobox .

If we use lightning:select or lightning:combobox not able to select multiple picklist values. Could anyone please help me with this?

I have tried using multiple="true"​​​​​​​ in the lightning select tag but is not accepting.

<ui:inputSelect multiple="true" class="multiple" aura:id="InputSelectMultiple" change="{!c.onMultiSelectChange}">
        <ui:inputSelectOption text="Any"/>
        <ui:inputSelectOption text="Open"/>
        <ui:inputSelectOption text="Closed"/>
        <ui:inputSelectOption text="Closed Won"/>
 </ui:inputSelect>

Thanks,
Anil Kumar

Best Answer

Neither of lightning:select or lightning:combobox support multiple select (as per docs). Lightning:dualListBox is the appropriate component for this-

https://developer.salesforce.com/docs/component-library/bundle/lightning:dualListbox/example

Related Topic