From 5bf1edda72ede16cd76e3d239923c905749a276e Mon Sep 17 00:00:00 2001 From: cyfung1031 <44498510+cyfung1031@users.noreply.github.com> Date: Tue, 17 Feb 2026 08:16:06 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=BC=B9=E5=87=BA?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E8=B7=9F=E9=9A=8F=E5=B1=8F=E5=B9=95=E6=BB=9A?= =?UTF-8?q?=E5=8A=A8=E7=9A=84=E9=97=AE=E9=A2=98=20-=20v2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/components/layout/MainLayout.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/pages/components/layout/MainLayout.tsx b/src/pages/components/layout/MainLayout.tsx index d936c7e01..968a7b601 100644 --- a/src/pages/components/layout/MainLayout.tsx +++ b/src/pages/components/layout/MainLayout.tsx @@ -295,14 +295,18 @@ const MainLayout: React.FC<{ }} locale={arcoLocale(i18n.language)} componentConfig={{ - Popconfirm: { + Select: { getPopupContainer: (node) => { - return node.parentNode as Element; + return node; }, }, }} getPopupContainer={(node) => { - return node; + let p = node.parentNode as Element; + p = p.closest("button")?.parentNode as Element || p; // 確保 ancestor 沒有 button 元素 + p = p.closest("span")?.parentNode as Element || p; // 確保 ancestor 沒有 span 元素 + p = p.closest("aside")?.parentNode as Element || p; // 確保 ancestor 沒有 aside 元素 + return p; }} > {contextHolder} From 64ea39b17077cc798854401a34249b681d9fd403 Mon Sep 17 00:00:00 2001 From: cyfung1031 <44498510+cyfung1031@users.noreply.github.com> Date: Tue, 17 Feb 2026 08:57:39 +0900 Subject: [PATCH 2/2] lint --- src/pages/components/layout/MainLayout.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/components/layout/MainLayout.tsx b/src/pages/components/layout/MainLayout.tsx index 968a7b601..e2c670fbc 100644 --- a/src/pages/components/layout/MainLayout.tsx +++ b/src/pages/components/layout/MainLayout.tsx @@ -303,9 +303,9 @@ const MainLayout: React.FC<{ }} getPopupContainer={(node) => { let p = node.parentNode as Element; - p = p.closest("button")?.parentNode as Element || p; // 確保 ancestor 沒有 button 元素 - p = p.closest("span")?.parentNode as Element || p; // 確保 ancestor 沒有 span 元素 - p = p.closest("aside")?.parentNode as Element || p; // 確保 ancestor 沒有 aside 元素 + p = (p.closest("button")?.parentNode as Element) || p; // 確保 ancestor 沒有 button 元素 + p = (p.closest("span")?.parentNode as Element) || p; // 確保 ancestor 沒有 span 元素 + p = (p.closest("aside")?.parentNode as Element) || p; // 確保 ancestor 沒有 aside 元素 return p; }} >