From 73e5ed649f04fc8ad899664d9c7f36215ae56bd3 Mon Sep 17 00:00:00 2001 From: cyfung1031 <44498510+cyfung1031@users.noreply.github.com> Date: Tue, 17 Mar 2026 08:49:10 +0900 Subject: [PATCH 1/4] fix getPopupContainer --- src/pages/components/layout/MainLayout.tsx | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/pages/components/layout/MainLayout.tsx b/src/pages/components/layout/MainLayout.tsx index e2c670fbc..da09d41cf 100644 --- a/src/pages/components/layout/MainLayout.tsx +++ b/src/pages/components/layout/MainLayout.tsx @@ -119,6 +119,14 @@ const importByUrls = async (urls: string[]): Promise => return stat; }; +const getSafePopupParent = (p: Element) => { + p = (p.closest("button")?.parentNode as Element) || p; // 確保 ancestor 沒有 button 元素 + p = (p.closest("span")?.parentNode as Element) || p; // 確保 ancestor 沒有 span 元素 + p = (p.closest(".arco-collapse-item-content")?.parentNode as Element) || p; // 確保 ancestor 沒有 .arco-collapse-item-content 元素 + p = (p.closest("aside")?.parentNode as Element) || p; // 確保 ancestor 沒有 aside 元素 + return p; +}; + // --- 子组件:提取拖拽遮罩以优化性能 --- const DropzoneOverlay: React.FC<{ active: boolean; text: string }> = React.memo(({ active, text }) => { if (!active) return null; @@ -297,16 +305,12 @@ const MainLayout: React.FC<{ componentConfig={{ Select: { getPopupContainer: (node) => { - return node; + return getSafePopupParent(node as Element); }, }, }} 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 元素 - return p; + return getSafePopupParent(node.parentNode as Element); }} > {contextHolder} From a78a25490d1af63c740378c89e6199674807bc9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E4=B8=80=E4=B9=8B?= Date: Tue, 17 Mar 2026 09:44:08 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=F0=9F=90=9B=20=E4=BF=AE=E5=A4=8D=20pre-com?= =?UTF-8?q?mit=20hook=20lint-fix=20=E4=BF=AE=E6=94=B9=E6=9C=AA=E5=8A=A0?= =?UTF-8?q?=E5=85=A5=E6=9A=82=E5=AD=98=E5=8C=BA=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .husky/pre-commit | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index fd92f4e77..e65f3812b 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,3 +1,13 @@ #!/bin/sh -pnpm run lint-fix \ No newline at end of file +pnpm run lint-fix + +# 将已暂存且被 lint-fix 修改过的文件重新加入暂存区 +STAGED=$(git diff --cached --name-only --diff-filter=d) +CHANGED=$(git diff --name-only) + +for file in $CHANGED; do + case "$STAGED" in + *"$file"*) git add "$file" ;; + esac +done From acaf1feab4a68c3747b1724a817eaf3d77f77779 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E4=B8=80=E4=B9=8B?= Date: Tue, 17 Mar 2026 09:53:12 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=F0=9F=90=9B=20=E4=BF=AE=E5=A4=8D=E8=BF=90?= =?UTF-8?q?=E8=A1=8C=E6=97=A5=E5=BF=97=E9=A1=B5=E9=9D=A2=E6=97=A5=E6=9C=9F?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E5=BC=B9=E5=87=BA=E6=A1=86=E8=A2=AB=20overfl?= =?UTF-8?q?ow=20=E5=AE=B9=E5=99=A8=E8=A3=81=E5=89=AA=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/options/routes/Logger.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/options/routes/Logger.tsx b/src/pages/options/routes/Logger.tsx index 8cf1db927..93998300f 100644 --- a/src/pages/options/routes/Logger.tsx +++ b/src/pages/options/routes/Logger.tsx @@ -133,6 +133,7 @@ function LoggerPage() { style={{ width: 400 }} showTime shortcutsPlacementLeft + getPopupContainer={() => document.body} value={[startTime * 1000, endTime * 1000]} onChange={(_, time) => { setStartTime(time[0].unix()); From 8c5be626728fab25bd4536164fb8cf22a3110f3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E4=B8=80=E4=B9=8B?= Date: Tue, 17 Mar 2026 09:53:34 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=F0=9F=94=A7=20=E4=BF=AE=E5=A4=8D=20husky?= =?UTF-8?q?=20hook=20=E5=8F=AF=E6=89=A7=E8=A1=8C=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .husky/pre-commit | 0 .husky/pre-push | 0 2 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 .husky/pre-commit mode change 100644 => 100755 .husky/pre-push diff --git a/.husky/pre-commit b/.husky/pre-commit old mode 100644 new mode 100755 diff --git a/.husky/pre-push b/.husky/pre-push old mode 100644 new mode 100755