From f6258c17e71d4ecfdef729c1678c181228456ee0 Mon Sep 17 00:00:00 2001 From: Rohan Agarwal <47861399+roaga@users.noreply.github.com> Date: Wed, 20 Nov 2024 15:35:25 -0800 Subject: [PATCH] fix(autofix): Allow keyboard submit on autofix start (#81092) Before you had to click the button to start Autofix. Now you can directly submit by hitting enter if you're giving starting context. --- .../streamline/solutionsHubDrawer.tsx | 67 ++++++++++--------- 1 file changed, 35 insertions(+), 32 deletions(-) diff --git a/static/app/views/issueDetails/streamline/solutionsHubDrawer.tsx b/static/app/views/issueDetails/streamline/solutionsHubDrawer.tsx index 8f45becd1c58d7..11bbbcbcd724c3 100644 --- a/static/app/views/issueDetails/streamline/solutionsHubDrawer.tsx +++ b/static/app/views/issueDetails/streamline/solutionsHubDrawer.tsx @@ -43,7 +43,8 @@ interface AutofixStartBoxProps { function AutofixStartBox({onSend, groupId}: AutofixStartBoxProps) { const [message, setMessage] = useState(''); - const send = () => { + const handleSubmit = (e: React.FormEvent) => { + e.preventDefault(); onSend(message); }; @@ -63,37 +64,39 @@ function AutofixStartBox({onSend, groupId}: AutofixStartBoxProps) { Autofix

Work together with Autofix to find the root cause and fix the issue.

- - setMessage(e.target.value)} - placeholder={'(Optional) Share helpful context here...'} - /> - - - - - - - +
+ + setMessage(e.target.value)} + placeholder={'(Optional) Share helpful context here...'} + /> + + + + + + + +
);