-
Notifications
You must be signed in to change notification settings - Fork 627
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Select Menu Searchable is slow with approx 180 entries #388
Comments
I'm running into the same issue. Any suggestions here? |
@benjamincanac Can you please suggest if there is a way to improve the performance here. |
This is a duplicate of #280, we need to look around useVirtualList. |
In the meantime I went with a custom build. It does not support Async calls, but works with static data quite OK.
|
Can the newest async search from #426 solve your issue? https://ui.nuxtlabs.com/forms/select-menu#async-search |
It's still just as slow for me. I tested it with a country list from const searchCountry = async (q) => {
return countries.filter(e => !q || e.toLowerCase().search(q) > -1)
} same with const searchCountry = async (q) => countries I've built a quite special workaround to pick a language out of iso6391. The I also use the standard javascript filter function here. const languagesList = computed(() => {
return languages.filter(e => (languageSearch.value) ? e.fullname.toLowerCase().search(languageSearch.value.toLowerCase()) > -1 : e)
}) |
I have a similar performance issue when it comes to the Select Menu. I have around 200 entries and the hover effect is lagging behind the cursor for half a second. @benjamincanac: Using a useVirtualList might be a good idea to bump up the speed. I've tried to implement it myself but that requires a bit of reordering of the HTML structure, so I decided to go back to work. @benjamincanac if you're ok with some template restructuring I could get back to it and create a MR. |
Dear Nuxtlabs team,
I have a Searchable Select Menu with around 180 entries. I have noticed that after upgrading to v2.5 (potentially), it became very slow. It takes around 5 seconds to open the search bar. Then the search itself is fast. If I remove searchable attribute, it works fast again, but given total number of option, search function is a must.
Here is my component:
<USelectMenu :model-value="modelValue" searchable multiple :options="adfeaturesStore" option-attribute="text" size="lg" @update:model-value="value => {modelValue = value; $emit('returnFeatures', modelValue)}" :searchable-placeholder="t('titles.search')" />
And my options array looks as follows:
{id: 1, value: "sizcnewborn", text: "Size (clothes): Newborn"}, {id: 2, value: "sizc3t6m", text: "Size (clothes): 3-6 months"}, {id: 3, value: "sizc6t9m", text: "Size (clothes): 6-9 months"}, {id: 4, value: "sizc9t12m", text: "Size (clothes): 9-12 months"}, {id: 5, value: "sizc12t18m", text: "Size (clothes): 12-18 months"}
Could this be a bug as could have weeks back it was working fine? Or is there something that I do incorrectly?
Thanks in advance!
The text was updated successfully, but these errors were encountered: