Restore defaults and behaviour with pick entity on PickEntity.vue

This commit is contained in:
Julien Fastré 2025-07-09 18:08:04 +02:00
parent dcdfba5ccd
commit d8bd9bd7cd
Signed by: julienfastre
GPG Key ID: BDE2190974723FCB
2 changed files with 6 additions and 5 deletions

View File

@ -124,9 +124,10 @@ function loadDynamicPicker(element) {
removeEntity({ entity }) {
if (
-1 ===
this.suggested.findIndex(
(e) => e.type === entity.type && e.id === entity.id,
)
this.suggested.findIndex(
(e) => e.type === entity.type && e.id === entity.id,
) &&
"me" !== entity
) {
this.suggested.push(entity);
}

View File

@ -1,6 +1,6 @@
<template>
<div class="grey-card">
<ul :class="listClasses" v-if="picked.length && displayPicked">
<ul :class="listClasses" v-if="picked.length > 0 && displayPicked">
<li
v-for="p in picked"
@click="removeEntity(p)"
@ -103,7 +103,7 @@ const props = withDefaults(
label?: string;
isCurrentUserPicker?: boolean;
}>(),
{ isCurrentUserPicker: false },
{ isCurrentUserPicker: false, displayPicked: true, removableIfSet: true },
);
const emits = defineEmits<{