Skip to content

Commit

Permalink
feat(Assistant): Add shift+enter support on desktop conversation bar
Browse files Browse the repository at this point in the history
  • Loading branch information
JF-Cozy committed Oct 23, 2024
1 parent 5a02c05 commit ac033c5
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/assistant/Conversations/ConversationBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,15 @@ const ConversationBar = ({ assistantStatus }) => {
</IconButton>
),
onKeyDown: ev => {
if (!isMobile && ev.key === 'Enter') {
ev.preventDefault() // prevent form submit
handleClick()
if (!isMobile) {
if (ev.shiftKey && ev.key === 'Enter') {
return ev
}

if (ev.key === 'Enter') {
ev.preventDefault() // prevent form submit
return handleClick()
}
}
}
}
Expand Down

0 comments on commit ac033c5

Please sign in to comment.