From f9f17bcaa065899853e45b644d18e19c9487e12f Mon Sep 17 00:00:00 2001 From: koji Date: Tue, 23 Apr 2024 13:21:04 -0400 Subject: [PATCH] address feedback --- .../src/organisms/PromptButton/index.tsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/opentrons-ai-client/src/organisms/PromptButton/index.tsx b/opentrons-ai-client/src/organisms/PromptButton/index.tsx index f5f735cfda1..452a615e67b 100644 --- a/opentrons-ai-client/src/organisms/PromptButton/index.tsx +++ b/opentrons-ai-client/src/organisms/PromptButton/index.tsx @@ -34,10 +34,14 @@ export function PromptButton({ buttonText }: PromptButtonProps): JSX.Element { React.useContext(setPromptContext) const setPrompt = usePromptSetValue() - const handleClick = useCallback(() => { - const { prompt } = PROMPT_BY_NAME[buttonText] - setPrompt(prompt) - }, [setPrompt, buttonText]) + const handleClick = useCallback( + (event: React.MouseEvent) => { + const { prompt } = PROMPT_BY_NAME[buttonText] + setPrompt(prompt) + event.currentTarget.blur() + }, + [setPrompt, buttonText] + ) return {buttonText} }