Skip to content

Commit

Permalink
[Fix] fix modal cannot close (#3264)
Browse files Browse the repository at this point in the history
Co-authored-by: Zzm0809 <[email protected]>
  • Loading branch information
Zzm0809 and Zzm0809 authored Mar 9, 2024
1 parent 1129b69 commit 53e72f1
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,17 @@ export const BuildSteps: React.FC<BuildStepsProps> = (props) => {
* render
*/
return (
<Modal title={title} width={'85%'} open={true} maskClosable={false} footer={footerButtons}>
<Modal
title={title}
width={'85%'}
open={true}
maskClosable={false}
destroyOnClose
centered
closable={false}
onCancel={() => handleCancel()}
footer={footerButtons}
>
<AutoSteps
steps={steps}
percent={percent}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import { folderSeparator, renderIcon } from '@/utils/function';
* @param data
* @returns {any}
*/
export const buildTreeData = (data: any): any =>
data?.map((item: any) => {
export const buildTreeData = (data: any[] = []): any =>
data.map((item: any) => {
// build key
let buildKey = item.path + folderSeparator() + item.name;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { Modal } from 'antd';
import React from 'react';

type CodeTreeProps = {
onCancel: (flag?: boolean) => void;
onCancel: () => void;
modalVisible: boolean;
values: Partial<GitProject>;
};
Expand All @@ -41,9 +41,12 @@ export const CodeTree: React.FC<CodeTreeProps> = (props) => {
overflow: 'auto'
}
}}
centered
closable={false}
open={modalVisible}
maskClosable={false}
onCancel={() => onCancel()}
destroyOnClose
maskClosable={false}
cancelText={l('button.close')}
okButtonProps={{ style: { display: 'none' } }}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ const TemplateModal: React.FC<TemplateModalProps> = (props) => {
title={values.id ? l('rc.template.modify') : l('rc.template.create')}
open={visible}
form={form}
modalProps={{ onCancel: handleCancel }}
submitter={{ render: () => [...renderFooter()] }}
initialValues={values}
>
Expand Down

0 comments on commit 53e72f1

Please sign in to comment.