Skip to content

Commit

Permalink
fix(ask): wrap onSend in AskButton onClick for Enter key handling
Browse files Browse the repository at this point in the history
  • Loading branch information
crazygo committed Nov 4, 2024
1 parent 55b6b8b commit b096bfe
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/ask-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,9 @@ function AskPanel(props: AskPanelProps) {
<AskButton
primary
disabled={!(userInput || initQuotes.length)}
onClick={onSend}
onClick={() => {
onSend();
}}
onKeyDown={e => {
if (e.key === 'Enter' && !e.shiftKey && !e.ctrlKey && !e.altKey) {
e.preventDefault();
Expand Down

0 comments on commit b096bfe

Please sign in to comment.