Limiting Number of Autocomplete Prompts


Is there any way to configure a limit on the number of autocomplete prompts that appear when a user starts to type a query? I have an Answers experience that will have a large percentage of mobile users and the number of autocomplete suggestions appearing when a user starts typing something like “how” seems to crowd the screen.


You could use CSS to hide results like so (you can also change the li selector to be a specific class if there are other list items you don’t want to hide):

// show first 5 results only
.yxt-AutoComplete-results li:nth-child(n+6)
    display: none

Before and after:

1 Like

Thank you @Nirmal_Patel! Worked perfectly :slight_smile: