From 6c3e75634f5f821165a81a0958653e46ab10c085 Mon Sep 17 00:00:00 2001 From: YuTengjing Date: Fri, 27 Feb 2026 23:20:49 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20prevent=20editor=20from?= =?UTF-8?q?=20stealing=20focus=20in=20agent=20settings=20modal=20(#12512)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/[variants]/(main)/agent/profile/index.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/app/[variants]/(main)/agent/profile/index.tsx b/src/app/[variants]/(main)/agent/profile/index.tsx index 6009cb2d73..b32685eb7a 100644 --- a/src/app/[variants]/(main)/agent/profile/index.tsx +++ b/src/app/[variants]/(main)/agent/profile/index.tsx @@ -46,8 +46,12 @@ const ProfileArea = memo(() => { height={'100%'} style={styles.contentWrapper} width={'100%'} - onClick={() => { - editor?.focus(); + onClick={(e) => { + // Only focus editor for clicks within this DOM element, + // not from React portal (e.g. Modal) whose DOM is outside this tree + if (e.currentTarget.contains(e.target as Node)) { + editor?.focus(); + } }} >