Skip to content

Commit

Permalink
fix(portal-web): 文件管理重命名模态框双击触发文件列表双击事件 (#960)
Browse files Browse the repository at this point in the history
事件冒泡了触发了 table 上绑定的双击事件,将模态框阻止冒泡
  • Loading branch information
Miracle575 authored Nov 8, 2023
1 parent 35e026b commit e50c921
Showing 1 changed file with 22 additions and 19 deletions.
41 changes: 22 additions & 19 deletions apps/portal-web/src/pageComponents/filemanager/RenameModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,24 +54,27 @@ export const RenameModal: React.FC<Props> = ({ open, onClose, path, reload, clus
};

return (
<Modal
open={open}
title={t(p("title"))}
okText={t("button.confirmButton")}
cancelText={t("button.cancelButton")}
onCancel={onClose}
confirmLoading={loading}
destroyOnClose
onOk={form.submit}
>
<Form form={form} onFinish={onSubmit}>
<Form.Item label={t(p("renameLabel"))}>
<strong>{path}</strong>
</Form.Item>
<Form.Item<FormProps> label={t(p("newFileName"))} name="newFileName" rules={[{ required: true }]}>
<Input />
</Form.Item>
</Form>
</Modal>
<div onDoubleClick={(event) => event.stopPropagation()}>
<Modal
open={open}
title={t(p("title"))}
okText={t("button.confirmButton")}
cancelText={t("button.cancelButton")}
onCancel={onClose}
confirmLoading={loading}
destroyOnClose
onOk={form.submit}
getContainer={false}
>
<Form form={form} onFinish={onSubmit}>
<Form.Item label={t(p("renameLabel"))}>
<strong>{path}</strong>
</Form.Item>
<Form.Item<FormProps> label={t(p("newFileName"))} name="newFileName" rules={[{ required: true }]}>
<Input />
</Form.Item>
</Form>
</Modal>
</div>
);
};

0 comments on commit e50c921

Please sign in to comment.