Skip to content

Commit 55117ec

Browse files
committed
fix(chat): combine Enter key checks to prevent form submission during composition
1 parent 30a5501 commit 55117ec

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

apps/postgres-new/components/chat.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -506,12 +506,7 @@ export default function Chat() {
506506
return
507507
}
508508

509-
if ( e.nativeEvent.isComposing )
510-
{
511-
return
512-
}
513-
514-
if (e.key === 'Enter' && !e.shiftKey) {
509+
if (e.key === 'Enter' && !e.shiftKey && !e.nativeEvent.isComposing) {
515510
e.preventDefault()
516511
if (!isLoading && isSubmitEnabled) {
517512
handleFormSubmit(e)

0 commit comments

Comments
 (0)