Skip to content

Commit c12ea53

Browse files
authored
fix(Listbox): re-assign modelValue to trigger the update event (#1864)
1 parent 3f80a68 commit c12ea53

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/core/src/shared/useSelectionBehavior.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ export function useSelectionBehavior<T>(
1818
else {
1919
const index = modelValue.value.findIndex(v => condition(v))
2020
if (index !== -1)
21-
modelValue.value.splice(index, 1)
21+
modelValue.value = modelValue.value.filter((_, i) => i !== index)
2222
else
23-
modelValue.value.push(val)
23+
modelValue.value = [...modelValue.value, val]
2424
}
2525
}
2626
// single select

0 commit comments

Comments
 (0)