diff --git a/client/src/components/History/Content/ContentItem.vue b/client/src/components/History/Content/ContentItem.vue index a4bf4c8c398b..aeae2c6bff83 100644 --- a/client/src/components/History/Content/ContentItem.vue +++ b/client/src/components/History/Content/ContentItem.vue @@ -84,6 +84,7 @@ :elements-datatypes="item.elements_datatypes" /> { disabled: false, }); + wrapper.find(toggleButton).trigger("click"); + await wrapper.vm.$nextTick(); + const multiselect = wrapper.find(".multiselect"); - multiselect.find("button").trigger("click"); await wrapper.vm.$nextTick(); - const options = multiselect.findAll(".multiselect-option"); const visibleOptions = options.filter((option) => option.isVisible()); @@ -85,10 +87,9 @@ describe("StatelessTags", () => { disabled: false, }); - const multiselect = wrapper.find(".multiselect"); - - multiselect.find("button").trigger("click"); + wrapper.find(toggleButton).trigger("click"); await wrapper.vm.$nextTick(); + const multiselect = wrapper.find(".multiselect"); await multiselect.find("input").setValue("new_tag"); await wrapper.vm.$nextTick(); multiselect.find(".multiselect-option").trigger("click"); @@ -103,10 +104,9 @@ describe("StatelessTags", () => { disabled: false, }); - const multiselect = wrapper.find(".multiselect"); - - multiselect.find("button").trigger("click"); + wrapper.find(toggleButton).trigger("click"); await wrapper.vm.$nextTick(); + const multiselect = wrapper.find(".multiselect"); await multiselect.find("input").setValue(":illegal_tag"); await wrapper.vm.$nextTick(); diff --git a/client/src/components/TagsMultiselect/StatelessTags.vue b/client/src/components/TagsMultiselect/StatelessTags.vue index a00f45bafcda..053ade18ace9 100644 --- a/client/src/components/TagsMultiselect/StatelessTags.vue +++ b/client/src/components/TagsMultiselect/StatelessTags.vue @@ -2,8 +2,9 @@ import { library } from "@fortawesome/fontawesome-svg-core"; import { faCheck, faPlus, faTags, faTimes } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome"; +import { BButton } from "bootstrap-vue"; import type { Ref } from "vue"; -import { computed, ref } from "vue"; +import { computed, nextTick, ref } from "vue"; import Multiselect from "vue-multiselect"; import { useToast } from "@/composables/toast"; @@ -20,7 +21,6 @@ interface StatelessTagsProps { useToggleLink?: boolean; maxVisibleTags?: number; placeholder?: string; - noPadding?: boolean; } const props = withDefaults(defineProps(), { @@ -68,8 +68,9 @@ const { editing, ariaExpanded, onOpen, onClose } = useMultiselect(); const multiselectElement: Ref = ref(null); -function openMultiselect() { - //@ts-ignore bad library types +async function openMultiselect() { + editing.value = true; + await nextTick(); multiselectElement.value?.activate(); } @@ -110,67 +111,82 @@ function onTagClicked(tag: string) {