fix: slash command behavior
This commit is contained in:
parent
805668bebc
commit
7281a2f078
1 changed files with 11 additions and 0 deletions
|
|
@ -152,6 +152,17 @@ const UserInput: React.FC<UserInputProps> = ({
|
|||
}
|
||||
}
|
||||
|
||||
// Check if there are any matching commands
|
||||
const filteredCommands = allCommands.filter((cmd) =>
|
||||
cmd.name.toLowerCase().includes(afterSlash.toLowerCase()),
|
||||
);
|
||||
|
||||
// If no commands match, hide the dropdown to allow normal Enter behavior
|
||||
if (filteredCommands.length === 0) {
|
||||
setShowSlashCommands(false);
|
||||
return;
|
||||
}
|
||||
|
||||
// Show selector for partial matches
|
||||
setShowSlashCommands(true);
|
||||
setSlashCommandFilter(afterSlash);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue