Skip to content

Commit

Permalink
fix(FilteredModelSelect): fix fetching of missing modelValue id
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanvanherwijnen committed Jun 3, 2024
1 parent 0347095 commit 0bb7339
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
5 changes: 5 additions & 0 deletions .changeset/twelve-insects-peel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@simsustech/quasar-components": patch
---

fix(FilteredModelSelect): fix fetching of missing modelValue id
20 changes: 10 additions & 10 deletions packages/components/src/ui/form/FilteredModelSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default {
generic="T extends { id: number; [key: string]: unknown }"
>
import { QSelect } from 'quasar'
import { computed, ref, toRefs, useAttrs, watch, onMounted } from 'vue'
import { computed, ref, toRefs, useAttrs, watch } from 'vue'
import { useLang } from './lang/index.js'
interface Props {
Expand Down Expand Up @@ -132,20 +132,20 @@ const filterFn: QSelect['$props']['onFilter'] = (val, update, abort) => {
const selectRef = ref<QSelect>()
watch(modelValue, () => {
if (!options.value.length)
if (!options.value?.find((val) => val.value === modelValue.value))
emit('filter', {
ids: selectedIds.value,
searchPhrase: '',
done: () => {}
})
})
onMounted(() => {
if (!options.value.length)
emit('filter', {
ids: selectedIds.value,
searchPhrase: '',
done: () => {}
})
})
// onMounted(() => {
// if (!options.value?.find((val) => val.value === modelValue.value))
// emit('filter', {
// ids: selectedIds.value,
// searchPhrase: '',
// done: () => {}
// })
// })
</script>

0 comments on commit 0bb7339

Please sign in to comment.