From 3010f20d13a35e0da886818f600565b949858b9f Mon Sep 17 00:00:00 2001 From: Konv Suu <2583695112@qq.com> Date: Fri, 1 Aug 2025 15:23:03 +0800 Subject: [PATCH] fix: conditional auto-focus based on last focused component (#8739) --- src/renderer/src/pages/home/Inputbar/Inputbar.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/renderer/src/pages/home/Inputbar/Inputbar.tsx b/src/renderer/src/pages/home/Inputbar/Inputbar.tsx index db82793781..11775e5ad7 100644 --- a/src/renderer/src/pages/home/Inputbar/Inputbar.tsx +++ b/src/renderer/src/pages/home/Inputbar/Inputbar.tsx @@ -704,7 +704,10 @@ const Inputbar: FC = ({ assistant: _assistant, setActiveTopic, topic }) = useEffect(() => { if (!document.querySelector('.topview-fullscreen-container')) { - textareaRef.current?.focus() + const lastFocusedComponent = PasteService.getLastFocusedComponent() + if (lastFocusedComponent === 'inputbar') { + textareaRef.current?.focus() + } } }, [assistant, topic])