-
Notifications
You must be signed in to change notification settings - Fork 587
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
fix(InputMenu/SelectMenu): use by
prop to compare objects & support dot notation in value-attribute
#2566
Conversation
by
prop to compare objects for selected values & add support for dot notation in value-attribute
by
prop to compare objects for selected values & add support for dot notation in value-attribute
by
prop to compare objects for selected values & add support for dot notation in value-attribute
by
prop to compare objects for selected values & add support for dot notation in value-attribute
by
prop to compare objects & support dot notation in value-attribute
@rdjanuar There seem to have an error with async search, try this: https://ui-dv8lpjs33-nuxt-js.vercel.app/components/select-menu#async-search |
There is one more thing, when you make an async search the selected item disappears when it's no longer in the options. You should change it so it behave like InputMenu, falling back to |
Do you think this #2342 is related? π€ |
i already fix that issue u can check here https://ui-dc7qpq1zz-nuxt-js.vercel.app/components/select-menu#async-search. I think the condition should rely on |
I want to ask, is it normal for the USelectMenu component to fetch data when using |
There is a The count is not fixed: |
You right @benjamincanac , we should rely on props.modelValue |
@rdjanuar With your latest commits, your no longer handling the |
Yes i remove it. Because i think condition |
Yeah but if a |
Well, I think we're good! Thanks a lot for your work on this π |
I think there is one last issue when using async search + |
may i know the issue? @benjamincanac |
When you're doing an async search and set a <script setup lang="ts">
const loading = ref(false)
const selected = ref([])
async function search(q: string) {
loading.value = true
const users: any[] = await $fetch('https://jsonplaceholder.typicode.com/users', { params: { q } })
loading.value = false
return users
}
</script>
<template>
<USelectMenu
v-model="selected"
:loading="loading"
:searchable="search"
placeholder="Search for a user..."
option-attribute="name"
value-attribute="id"
/>
</template> |
i think the fallback work correctly, maybe u can try it after deployment |
I just tried it locally, how can you fallback on a value that doesn't exist? The modelValue is equal to the id of the selected user. |
your right, i already test it and the label disappear hahahaha. i have no idea to handle that :(( |
Don't worry about it, I really don't think its possible.. |
π Linked issue
Resolves #2028, resolves #2086, resolves #2342, resolves #2464
β Type of change
π Description
π Checklist