Skip to content

Commit

Permalink
fix(chat): combine Enter key checks to prevent form submission during…
Browse files Browse the repository at this point in the history
… composition
  • Loading branch information
riya-amemiya committed Aug 20, 2024
1 parent 30a5501 commit 55117ec
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions apps/postgres-new/components/chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -506,12 +506,7 @@ export default function Chat() {
return
}

if ( e.nativeEvent.isComposing )
{
return
}

if (e.key === 'Enter' && !e.shiftKey) {
if (e.key === 'Enter' && !e.shiftKey && !e.nativeEvent.isComposing) {
e.preventDefault()
if (!isLoading && isSubmitEnabled) {
handleFormSubmit(e)
Expand Down

0 comments on commit 55117ec

Please sign in to comment.