Skip to content

Commit 8fe25fa

Browse files
committed
fix(add-modal): separate bulk action footer
1 parent c8e7a34 commit 8fe25fa

2 files changed

Lines changed: 185 additions & 180 deletions

File tree

src/components/AddModal/AddModal.tsx

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -320,23 +320,10 @@ const AddModal: React.FC = () => {
320320
/>
321321
</Tabs>
322322
<DialogContent
323-
sx={
324-
activeTab === "bulk"
325-
? {
326-
pt: 2,
327-
display: "flex",
328-
flex: "1 1 auto",
329-
minHeight: 0,
330-
overflow: "hidden",
331-
}
332-
: { pt: 2 }
333-
}
323+
sx={{ pt: 2, display: activeTab === "single" ? undefined : "none" }}
334324
>
335325
{/* single tab 内容:通过 display 控制显隐,避免切换 tab 时卸载 */}
336-
<Stack
337-
spacing={2}
338-
sx={{ pt: 1, display: activeTab === "single" ? undefined : "none" }}
339-
>
326+
<Stack spacing={2} sx={{ pt: 1 }}>
340327
{/* 选择本地可执行文件 */}
341328
<Button
342329
fullWidth
@@ -417,12 +404,12 @@ const AddModal: React.FC = () => {
417404
onChange={(event) => setFormText(event.target.value)}
418405
/>
419406
</Stack>
420-
{/* bulk tab:始终挂载,通过 hidden prop 控制显隐,保持状态在 tab 切换时不丢失 */}
421-
<BulkImportTab
422-
hidden={activeTab !== "bulk"}
423-
onClose={handleCloseModal}
424-
/>
425407
</DialogContent>
408+
{/* bulk tab:始终挂载,通过 hidden prop 控制显隐,保持状态在 tab 切换时不丢失 */}
409+
<BulkImportTab
410+
hidden={activeTab !== "bulk"}
411+
onClose={handleCloseModal}
412+
/>
426413
{activeTab === "single" && (
427414
<DialogActions>
428415
{/* 取消按钮 */}

0 commit comments

Comments
 (0)