Bug 32474: Store the selected option label
It prevents the label to be removed when the selected option is not longer in the item list. Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
parent
58283765b7
commit
2fe52a72a9
|
|
@ -7,6 +7,7 @@
|
|||
:reduce="item => item[dataIdentifier]"
|
||||
@open="onOpen"
|
||||
@close="onClose"
|
||||
@option:selected="onSelected"
|
||||
@search="searchFilter($event)"
|
||||
ref="select"
|
||||
>
|
||||
|
|
@ -18,6 +19,9 @@
|
|||
v-on="events"
|
||||
/>
|
||||
</template>
|
||||
<template #selected-option="option">
|
||||
{{ selectedOptionLabel }}
|
||||
</template>
|
||||
<template #list-footer>
|
||||
<li v-show="hasNextPage && !this.search" ref="load">
|
||||
{{ $__("Loading more options...") }}
|
||||
|
|
@ -48,6 +52,7 @@ export default {
|
|||
scrollPage: null,
|
||||
data: [this.selectedData],
|
||||
paginationRequired: false,
|
||||
selectedOptionLabel: this.selectedData[this.label],
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
|
@ -131,6 +136,9 @@ export default {
|
|||
onClose() {
|
||||
this.observer.disconnect()
|
||||
},
|
||||
onSelected(option) {
|
||||
this.selectedOptionLabel = option[this.label]
|
||||
},
|
||||
async infiniteScroll([{ isIntersecting, target }]) {
|
||||
setTimeout(async () => {
|
||||
if (isIntersecting) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue