Skip to content

Commit f89f375

Browse files
committed
chore(ui) image-preview keep show mask
1 parent 8cfa7ca commit f89f375

2 files changed

Lines changed: 2 additions & 15 deletions

File tree

packages/ui/src/components/_mask/Mask.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { usePrefixConfig } from '../root';
88

99
export interface DMaskProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
1010
dVisible: boolean;
11-
onClose: () => void;
11+
onClose: (() => void) | undefined;
1212
afterVisibleChange?: (visible: boolean) => void;
1313
}
1414

packages/ui/src/components/image/ImagePreview.tsx

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ export interface DImagePreviewProps extends React.HTMLAttributes<HTMLDivElement>
1919
dActive?: number;
2020
dVisible?: boolean;
2121
dZIndex?: number | string;
22-
dMask?: boolean;
23-
dMaskClosable?: boolean;
2422
dEscClosable?: boolean;
2523
onActiveChange?: (index: number) => void;
2624
onClose?: () => void;
@@ -34,8 +32,6 @@ export function DImagePreview(props: DImagePreviewProps): JSX.Element | null {
3432
dActive,
3533
dVisible,
3634
dZIndex,
37-
dMask = true,
38-
dMaskClosable = true,
3935
dEscClosable = true,
4036
onActiveChange,
4137
onClose,
@@ -461,16 +457,7 @@ export function DImagePreview(props: DImagePreviewProps): JSX.Element | null {
461457
)
462458
)}
463459
</ul>
464-
{dMask && (
465-
<DMask
466-
dVisible
467-
onClose={() => {
468-
if (dMaskClosable) {
469-
changeVisible(false);
470-
}
471-
}}
472-
/>
473-
)}
460+
<DMask dVisible onClose={undefined} />
474461
</div>
475462
);
476463
}}

0 commit comments

Comments
 (0)