fix(Inputbar): fix enter key confict (#7679)

fix(Inputbar): prevent default behavior for Enter key when quick panel is visible
This commit is contained in:
Teo 2025-06-30 16:13:25 +08:00 committed by GitHub
parent 21ba35b6bf
commit db4ce9fb7f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -348,8 +348,9 @@ const Inputbar: FC<Props> = ({ assistant: _assistant, setActiveTopic, topic }) =
//other keys should be ignored
const isEnterPressed = event.key === 'Enter' && !event.nativeEvent.isComposing
if (isEnterPressed) {
if (isSendMessageKeyPressed(event, sendMessageShortcut)) {
if (quickPanel.isVisible) return event.preventDefault()
if (isSendMessageKeyPressed(event, sendMessageShortcut)) {
sendMessage()
return event.preventDefault()
} else {