Skip to content

Commit

Permalink
Revert "Fix reactivity of primeuve picker"
Browse files Browse the repository at this point in the history
This reverts commit d325db5.
  • Loading branch information
johnatawnclementawn authored and jacobtylerwalls committed Jan 17, 2025
1 parent 60bf896 commit 470616f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { computed, inject, ref, toRef, watch } from "vue";
import { computed, inject, toRef } from "vue";
import Select from "primevue/select";
import MultiSelect from "primevue/multiselect";
Expand Down Expand Up @@ -45,11 +45,6 @@ const val = computed({
},
});
const primeVuePickerVal = ref(val.value);
watch(primeVuePickerVal, (newVal) => {
val.value = newVal;
});
function extractURI(item: ControlledListItem[]): string | string[] {
if (item && !props.multiValue) {
return item[0]?.uri;
Expand All @@ -74,7 +69,7 @@ function getOptionLabels(item: ControlledListItem): string {

<template>
<Select
v-model="primeVuePickerVal"
v-model="val"
v-if:="!props.multiValue"
:show-toggle-all="options?.length"
:options
Expand All @@ -88,7 +83,7 @@ function getOptionLabels(item: ControlledListItem): string {
/>
<MultiSelect
v-if="props.multiValue"
v-model="primeVuePickerVal"
v-model="val"
:show-toggle-all="options?.length"
:options
:option-label="getOptionLabels"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { computed, toRef, ref, watch } from "vue";
import { computed, toRef } from "vue";
import MultiSelect from "primevue/multiselect";
import type { ResourceInstanceReference } from "@/arches_lingo/types";
import { useGettext } from "vue3-gettext";
Expand Down Expand Up @@ -28,15 +28,10 @@ const value = computed({
emit("update", value);
},
});
const primeVuePickerVal = ref(value.value);
watch(primeVuePickerVal, (newVal) => {
value.value = newVal;
});
</script>
<template>
<MultiSelect
v-model="primeVuePickerVal"
v-model="value"
:show-toggle-all="!!options?.length"
:options
option-label="display_value"
Expand Down

0 comments on commit 470616f

Please sign in to comment.