remove unused code

pull/30205/head
Lunny Xiao 2025-10-25 20:28:16 -07:00
parent 4a2734aaa2
commit fdd3bf04cb
No known key found for this signature in database
GPG Key ID: C3B7C91B632F738A
1 changed files with 0 additions and 21 deletions

View File

@ -118,33 +118,12 @@ const getLabelItem = (label: Label): string => {
const toggleLabel = (labelId: string) => {
if (props.readonly) return;
const clickedLabel = props.labels.find((l) => String(l.id) === labelId);
if (!clickedLabel) return;
const currentValues = [...props.modelValue];
const index = currentValues.indexOf(labelId);
if (index > -1) {
// Remove the label if already selected
currentValues.splice(index, 1);
} else {
// Handle exclusive labels: remove other labels in same scope
const exclusiveScope = getExclusiveScope(clickedLabel);
if (exclusiveScope) {
// Remove all labels with the same exclusive scope
const labelsToRemove = props.labels
.filter((l) => {
const scope = getExclusiveScope(l);
return scope === exclusiveScope && String(l.id) !== labelId;
})
.map((l) => String(l.id));
labelsToRemove.forEach((id) => {
const idx = currentValues.indexOf(id);
if (idx > -1) currentValues.splice(idx, 1);
});
}
if (props.multiple) {
currentValues.push(labelId);
} else {