File tree Expand file tree Collapse file tree 1 file changed +0
-21
lines changed Expand file tree Collapse file tree 1 file changed +0
-21
lines changed Original file line number Diff line number Diff line change @@ -118,33 +118,12 @@ const getLabelItem = (label: Label): string => {
118118const toggleLabel = (labelId : string ) => {
119119 if (props .readonly ) return ;
120120
121- const clickedLabel = props .labels .find ((l ) => String (l .id ) === labelId );
122- if (! clickedLabel ) return ;
123-
124121 const currentValues = [... props .modelValue ];
125122 const index = currentValues .indexOf (labelId );
126123
127124 if (index > - 1 ) {
128- // Remove the label if already selected
129125 currentValues .splice (index , 1 );
130126 } else {
131- // Handle exclusive labels: remove other labels in same scope
132- const exclusiveScope = getExclusiveScope (clickedLabel );
133- if (exclusiveScope ) {
134- // Remove all labels with the same exclusive scope
135- const labelsToRemove = props .labels
136- .filter ((l ) => {
137- const scope = getExclusiveScope (l );
138- return scope === exclusiveScope && String (l .id ) !== labelId ;
139- })
140- .map ((l ) => String (l .id ));
141-
142- labelsToRemove .forEach ((id ) => {
143- const idx = currentValues .indexOf (id );
144- if (idx > - 1 ) currentValues .splice (idx , 1 );
145- });
146- }
147-
148127 if (props .multiple ) {
149128 currentValues .push (labelId );
150129 } else {
You can’t perform that action at this time.
0 commit comments