(fullname: string)
| 236 | ); |
| 237 | |
| 238 | const toggle = (fullname: string) => { |
| 239 | if (disabled) return; |
| 240 | const binding = fullnameToBinding(fullname); |
| 241 | if (selectedFullnames.has(fullname)) { |
| 242 | labelCacheRef.current.delete(binding); |
| 243 | onChange(value.filter((v) => v !== binding)); |
| 244 | } else { |
| 245 | // Cache display label at selection time so it survives search changes |
| 246 | const label = resolveLabel(fullname); |
| 247 | if (label) labelCacheRef.current.set(binding, label); |
| 248 | onChange([...value, binding]); |
| 249 | } |
| 250 | }; |
| 251 | |
| 252 | const remove = (binding: string) => { |
| 253 | if (disabled) return; |
no test coverage detected