File tree Expand file tree Collapse file tree 4 files changed +22
-7
lines changed
Expand file tree Collapse file tree 4 files changed +22
-7
lines changed Original file line number Diff line number Diff line change 11#! /bin/sh
22
3- pnpm run lint-fix
3+ pnpm run lint-fix
4+
5+ # 将已暂存且被 lint-fix 修改过的文件重新加入暂存区
6+ STAGED=$( git diff --cached --name-only --diff-filter=d)
7+ CHANGED=$( git diff --name-only)
8+
9+ for file in $CHANGED ; do
10+ case " $STAGED " in
11+ * " $file " * ) git add " $file " ;;
12+ esac
13+ done
Original file line number Diff line number Diff line change @@ -119,6 +119,14 @@ const importByUrls = async (urls: string[]): Promise<TImportStat | undefined> =>
119119 return stat ;
120120} ;
121121
122+ const getSafePopupParent = ( p : Element ) => {
123+ p = ( p . closest ( "button" ) ?. parentNode as Element ) || p ; // 確保 ancestor 沒有 button 元素
124+ p = ( p . closest ( "span" ) ?. parentNode as Element ) || p ; // 確保 ancestor 沒有 span 元素
125+ p = ( p . closest ( ".arco-collapse-item-content" ) ?. parentNode as Element ) || p ; // 確保 ancestor 沒有 .arco-collapse-item-content 元素
126+ p = ( p . closest ( "aside" ) ?. parentNode as Element ) || p ; // 確保 ancestor 沒有 aside 元素
127+ return p ;
128+ } ;
129+
122130// --- 子组件:提取拖拽遮罩以优化性能 ---
123131const DropzoneOverlay : React . FC < { active : boolean ; text : string } > = React . memo ( ( { active, text } ) => {
124132 if ( ! active ) return null ;
@@ -297,16 +305,12 @@ const MainLayout: React.FC<{
297305 componentConfig = { {
298306 Select : {
299307 getPopupContainer : ( node ) => {
300- return node ;
308+ return getSafePopupParent ( node as Element ) ;
301309 } ,
302310 } ,
303311 } }
304312 getPopupContainer = { ( node ) => {
305- let p = node . parentNode as Element ;
306- p = ( p . closest ( "button" ) ?. parentNode as Element ) || p ; // 確保 ancestor 沒有 button 元素
307- p = ( p . closest ( "span" ) ?. parentNode as Element ) || p ; // 確保 ancestor 沒有 span 元素
308- p = ( p . closest ( "aside" ) ?. parentNode as Element ) || p ; // 確保 ancestor 沒有 aside 元素
309- return p ;
313+ return getSafePopupParent ( node . parentNode as Element ) ;
310314 } }
311315 >
312316 { contextHolder }
Original file line number Diff line number Diff line change @@ -133,6 +133,7 @@ function LoggerPage() {
133133 style = { { width : 400 } }
134134 showTime
135135 shortcutsPlacementLeft
136+ getPopupContainer = { ( ) => document . body }
136137 value = { [ startTime * 1000 , endTime * 1000 ] }
137138 onChange = { ( _ , time ) => {
138139 setStartTime ( time [ 0 ] . unix ( ) ) ;
You can’t perform that action at this time.
0 commit comments