Skip to content

Commit 08633a3

Browse files
committed
🐛 checking a checklist item freezes the browser-window because a recursion occurs when updating the modelValue
1 parent 09f0fd6 commit 08633a3

File tree

1 file changed

+2
-18
lines changed

1 file changed

+2
-18
lines changed

personalization-webcomponents/src/components/ChecklistList.vue

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div class="container">
33
<sortable
4-
:list="list"
4+
:list="modelValue"
55
tag="ul"
66
class="list"
77
:animation="200"
@@ -79,28 +79,12 @@ const props = withDefaults(
7979
disabled: false,
8080
}
8181
);
82-
const emit = defineEmits(["checked", "update:modelValue", "label-click"]);
83-
const list = ref<DummyChecklistItem[]>([...props.modelValue]);
82+
const emit = defineEmits(["checked", "label-click"]);
8483
const drag = ref(false);
8584
8685
const dialogVisible = ref(false);
8786
const dialogItem = ref<DummyChecklistItem | null>(null);
8887
89-
watch(
90-
() => props.modelValue,
91-
(newVal) => {
92-
list.value = [...newVal];
93-
}
94-
);
95-
96-
watch(
97-
list,
98-
(newVal) => {
99-
emit("update:modelValue", [...newVal]);
100-
},
101-
{ deep: true }
102-
);
103-
10488
function onSelectChange(serviceID: string) {
10589
emit("checked", serviceID);
10690
}

0 commit comments

Comments
 (0)