Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
:emptyLabel="$t(`collectionItemInput.select.emptyLabel`)"
:fetchList="(q) => services.collectionItem.findAll(collectionId, { q })"
:clearEnabled="true"
:displayAll="true"
buttonClass="h-10"
v-model="selectedCollectionItem"
>
Expand Down
11 changes: 8 additions & 3 deletions app/frontend/editor/components/kit/select-input.vue
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,11 @@ export default {
clearEnabled: { type: Boolean, default: false },
withLabel: { type: Boolean, default: true },
buttonClass: { type: [Object, String], default: () => ({}) },
displayAll: { type: Boolean, default: false },
},
data() {
if (this.displayAll) this.fetch()

return {
isOpen: false,
q: undefined,
Expand All @@ -128,7 +131,7 @@ export default {
},
methods: {
focus() {
this.toggle();
this.toggle()
},
toggle() {
this.isOpen = !this.isOpen
Expand Down Expand Up @@ -177,13 +180,15 @@ export default {
reset() {
this.isOpen = false
this.q = null
this.list = undefined
if (!this.displayAll) {
this.list = undefined
}
this.focusIndex = undefined
},
},
watch: {
q() {
if (!this.q) return
if (!this.q && !this.displayAll) return
this.debouncedFetch()
},
isOpen() {
Expand Down