fix: assign select

This commit is contained in:
puriphatt 2024-10-11 10:08:11 +07:00
parent 96759bac24
commit 389995ad76

View file

@ -55,6 +55,7 @@ function assignSelect(to: unknown[], from: unknown[]) {
to.splice(i, 1);
}
}
to.sort((a, b) => from.indexOf(a) - from.indexOf(b));
const newItems = from.filter((item) => !existingItems.has(item));
to.push(...newItems);