fix conditions with separators

This commit is contained in:
Jordan Blasenhauer 2024-07-03 10:10:39 +02:00
parent 9510b94e7e
commit 865e66c382
2 changed files with 4 additions and 5 deletions

View file

@ -145,7 +145,7 @@ const props = defineProps({
const inp = reactive({
isOpen: false,
id: "",
value: props.value,
value: props.value.trim(),
values: computed(() => {
return inp.value.split(props.separator);
}),
@ -162,8 +162,8 @@ const inp = reactive({
// Check if enter value is already a value
isEnterMatching: computed(() => {
if (!inp.enterValue) return false;
if (!props.value.split(props.separator)) return false;
return props.value
if (!inp.value.split(props.separator)) return false;
return inp.value
.split(props.separator)
.some((str) => str.toLowerCase() === inp.enterValue.toLowerCase());
}),
@ -353,7 +353,6 @@ const emits = defineEmits(["inp"]);
:hideLabel="props.hideLabel"
:headerClass="props.headerClass"
/>
<!--custom-->
<div class="relative">
<div data-input-container class="input-regular-container">

View file

@ -7,7 +7,7 @@ import DashboardLayout from "@components/Dashboard/Layout.vue";
const list = {
id: "test-input",
value: "yes no maybe I don't know can you repeat the question",
value: "yes no maybe I don't know can you repeat the question ",
name: "test-list",
label: "Test list",
inpType: "list",