0

The below code produces a list of 50 accounts that display in a picklist. I need to have more items to display in the picklist. How can I do this? Can I change the type of picklist?

<lightning:select name="customField1Filter"
                  class="slds-p-horizontal--small"
                  onchange="{!c.onFilterMembers}"
                  label="{!v.pickListLabelField1}"
                  value="{!v.searchCustomField1}">
                <aura:iteration items="{!v.accountValues}" var="account">
                    <option value="{!account}">{!account}</option>
                </aura:iteration>
</lightning:select>
  • Even though you are able to populate them in a single picklist, that would be bad design from UX perspective. Have you considered using type ahead approach for showing accounts, as user types in the box? – Salesforcesmarty Jul 19 '18 at 0:09
  • How do you populate over 50 in a picklist? I have the following code doing a type ahead, but I would like to populate about 60. It stops at 50. lightning:input type="search" class="slds-p-horizontal--small" value="{!v.searchCustomField1}" onchange="{!c.onSearchCustomField}" name="customField1" placeholder="{!v.placeHolderCustomField1}" label="{!v.labelCustomField1}"/> – Michele Kleinhomer Jul 19 '18 at 0:13
  • But why are you even doing that? Just display top 10 results and keep filtering as the user keeps typing? – Salesforcesmarty Jul 19 '18 at 0:17
  • Because the user might not know the way the accounts are entered in the system...for our environment a picklist will work best. The # of them isn't going to grow much past 60. Is there a way to show more than 50 in the dropdown picklist? – Michele Kleinhomer Jul 19 '18 at 0:23
  • 2
    There's no known limit document about number of items in lightning:select. Check if your list accountValues consists of the right set of data that you are trying to render. Please note, I was able to add 100 values in this component and was able to display as a test. – Jayant Das Jul 19 '18 at 1:19
0

The limit on the # of dropdown items was set in my org's custom code. I corrected this and everything works.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.