fix(front): preserve tags when modifiying post or event

closes #1307
closes #1289
This commit is contained in:
setop 2024-07-13 08:53:24 +02:00
parent 2078dbcf55
commit df6ffee7cf

View file

@ -15,8 +15,7 @@
</template> </template>
<o-taginput <o-taginput
:modelValue="tagsStrings" :modelValue="tagsStrings"
@remove="remove" @update:modelValue="updateTags"
@add="add"
:data="filteredTags" :data="filteredTags"
:allow-autocomplete="true" :allow-autocomplete="true"
:allow-new="true" :allow-new="true"
@ -94,17 +93,6 @@ const filteredTags = computed((): ITag[] => {
); );
}); });
// TODO It seems that '@update:modelValue="updateTags"' does not works anymore...
// so temporarily call the function updateTags() at remove and add tag event
// https://github.com/oruga-ui/oruga/issues/967
function remove() {
updateTags(tagsStrings.value);
}
function add() {
updateTags(tagsStrings.value);
}
const updateTags = (newTagsStrings: string[]) => { const updateTags = (newTagsStrings: string[]) => {
const tagEntities = newTagsStrings.map((tag: string | ITag) => { const tagEntities = newTagsStrings.map((tag: string | ITag) => {
if (typeof tag !== "string") { if (typeof tag !== "string") {