mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-09 03:18:44 +00:00
fix: prevent double-toggle on tool/skill switches by stopping event propagation
The card onClick and Switch onChange both fired, canceling each other out. Stop propagation on the Switch click so only one handler runs. Co-authored-by: Ishaan Jaff <ishaan-jaff@users.noreply.github.com>
This commit is contained in:
parent
bbd9f0f2e6
commit
37d2caf5e9
1 changed files with 2 additions and 2 deletions
|
|
@ -115,7 +115,7 @@ const ToolCard: React.FC<{
|
|||
<div className="text-sm font-medium text-gray-900">{tool.name}</div>
|
||||
<div className="text-xs text-gray-500">{tool.description}</div>
|
||||
</div>
|
||||
<Switch checked={selected} onChange={onToggle} size="small" />
|
||||
<Switch checked={selected} size="small" onClick={(_, e) => e.stopPropagation()} onChange={onToggle} />
|
||||
</div>
|
||||
);
|
||||
|
||||
|
|
@ -134,7 +134,7 @@ const SkillCard: React.FC<{
|
|||
>
|
||||
<div className="flex items-center justify-between">
|
||||
<span className="text-sm font-medium text-gray-900">{skill.name}</span>
|
||||
<Switch checked={selected} onChange={onToggle} size="small" />
|
||||
<Switch checked={selected} size="small" onClick={(_, e) => e.stopPropagation()} onChange={onToggle} />
|
||||
</div>
|
||||
<div className="text-xs text-gray-500 mt-1">{skill.description}</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue