Skip to content

Commit

Permalink
fix conditions with separators
Browse files Browse the repository at this point in the history
  • Loading branch information
syrk4web committed Jul 3, 2024
1 parent 9510b94 commit 865e66c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions src/client/vite/src/components/Forms/Field/List.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}),
Expand All @@ -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());
}),
Expand Down Expand Up @@ -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">
Expand Down
2 changes: 1 addition & 1 deletion src/client/vite/src/pages/test/Test.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 865e66c

Please sign in to comment.