mirror of
https://github.com/NanmiCoder/cc-haha
synced 2026-07-19 13:33:35 +08:00
feat: support ESC key to close slash command panels
This commit is contained in:
parent
e1474b5c30
commit
628c4e16f9
@ -362,6 +362,14 @@ export function ChatInput({ variant = 'default' }: ChatInputProps) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (localSlashPanel) {
|
||||||
|
if (event.key === 'Escape') {
|
||||||
|
event.preventDefault()
|
||||||
|
setLocalSlashPanel(null)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (slashMenuOpen && filteredCommands.length > 0) {
|
if (slashMenuOpen && filteredCommands.length > 0) {
|
||||||
if (event.key === 'ArrowDown') {
|
if (event.key === 'ArrowDown') {
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user