mirror of
https://github.com/siteboon/claudecodeui.git
synced 2026-06-11 08:16:00 +08:00
fix(chat): ensure onSelect is called only for valid command indices
This commit is contained in:
@@ -194,7 +194,7 @@ export default function CommandMenu({
|
|||||||
isSelected ? 'bg-blue-50 dark:bg-blue-900' : 'bg-transparent'
|
isSelected ? 'bg-blue-50 dark:bg-blue-900' : 'bg-transparent'
|
||||||
}`}
|
}`}
|
||||||
onMouseEnter={() => onSelect && commandIndex >= 0 && onSelect(command, commandIndex, true)}
|
onMouseEnter={() => onSelect && commandIndex >= 0 && onSelect(command, commandIndex, true)}
|
||||||
onClick={() => onSelect && onSelect(command, commandIndex, false)}
|
onClick={() => onSelect && commandIndex >= 0 && onSelect(command, commandIndex, false)}
|
||||||
onMouseDown={(event) => event.preventDefault()}
|
onMouseDown={(event) => event.preventDefault()}
|
||||||
>
|
>
|
||||||
<div className="min-w-0 flex-1">
|
<div className="min-w-0 flex-1">
|
||||||
|
|||||||
Reference in New Issue
Block a user