From 4569ebf5fe10efd4cbd68391dc7a9466cf8d3b37 Mon Sep 17 00:00:00 2001 From: guerler Date: Fri, 11 Aug 2023 13:47:02 +0200 Subject: [PATCH] Enforce unique ids for multiselect fields --- .../components/Form/Elements/FormSelect.vue | 4 +++ .../Upload/UploadSettingsSelect.vue | 27 ++++++++++++++++--- .../selenium/test_library_contents.py | 3 +-- 3 files changed, 28 insertions(+), 6 deletions(-) diff --git a/client/src/components/Form/Elements/FormSelect.vue b/client/src/components/Form/Elements/FormSelect.vue index 0883247ac7e9..73782749de61 100644 --- a/client/src/components/Form/Elements/FormSelect.vue +++ b/client/src/components/Form/Elements/FormSelect.vue @@ -3,6 +3,7 @@ import { computed, type ComputedRef, onMounted, watch } from "vue"; import Multiselect from "vue-multiselect"; import { useMultiselect } from "@/composables/useMultiselect"; +import { uid } from "@/utils/utils"; type SelectValue = string | number | null; const { ariaExpanded, onOpen, onClose } = useMultiselect(); @@ -14,12 +15,14 @@ interface SelectOption { const props = withDefaults( defineProps<{ + id?: string; multiple?: boolean; optional?: boolean; options: Array<[string, SelectValue]>; value?: Array | string | number; }>(), { + id: `form-select-${uid()}`, multiple: false, optional: false, value: null, @@ -143,6 +146,7 @@ onMounted(() => {