Skip to content

Commit

Permalink
Merge pull request #17146 from ElectronicBlueberry/fix-multiselect-dr…
Browse files Browse the repository at this point in the history
…opdown-shown

[23.2] Fix select option appears for single select
  • Loading branch information
mvdbeek authored Dec 8, 2023
2 parents 8072dc8 + 5b74f37 commit 43b6d72
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions client/src/components/Form/Elements/FormSelection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,12 @@ watch(
{ immediate: true }
);
const displayMany = computed(
() => props.multiple && props.display !== "checkboxes" && props.display !== "radio" && useMany.value
);
const showManyButton = computed(
() => props.multiple && props.display !== "checkboxes" && props.display !== "radio" && !useMany.value
const showSelectPreference = computed(
() => props.multiple && props.display !== "checkboxes" && props.display !== "radio"
);
const displayMany = computed(() => showSelectPreference.value && useMany.value);
const showManyButton = computed(() => showSelectPreference.value && !useMany.value);
const showMultiButton = computed(() => displayMany.value);
</script>

Expand All @@ -114,7 +112,7 @@ const showMultiButton = computed(() => displayMany.value);
<FormSelectMany v-else-if="displayMany" v-model="currentValue" :options="currentOptions" />
<FormSelect v-else v-model="currentValue" :multiple="multiple" :optional="optional" :options="currentOptions" />

<div class="d-flex">
<div v-if="showSelectPreference" class="d-flex">
<button v-if="showManyButton" class="ui-link ml-1" @click="useMany = true">switch to column select</button>
<button v-else-if="showMultiButton" class="ui-link ml-1" @click="useMany = false">
switch to simple select
Expand Down

0 comments on commit 43b6d72

Please sign in to comment.