fix: stop propagation when drawer is opened

This commit is contained in:
chenos 2022-04-18 10:43:29 +08:00
parent e21d819155
commit 4510242651
2 changed files with 69 additions and 61 deletions

View File

@ -21,6 +21,11 @@ export const ActionDrawer: ComposedActionDrawer = observer((props) => {
return ( return (
<> <>
{createPortal( {createPortal(
<div
onClick={(e) => {
e.stopPropagation();
}}
>
<Drawer <Drawer
width={'50%'} width={'50%'}
title={field.title} title={field.title}
@ -81,7 +86,8 @@ export const ActionDrawer: ComposedActionDrawer = observer((props) => {
return s['x-component'] !== footerNodeName; return s['x-component'] !== footerNodeName;
}} }}
/> />
</Drawer>, </Drawer>
</div>,
document.body, document.body,
)} )}
</> </>

View File

@ -27,7 +27,9 @@ export const ReadPrettyRecordPicker: React.FC = observer((props: any) => {
return ( return (
<span> <span>
<a <a
onClick={() => { onClick={(e) => {
e.stopPropagation();
e.preventDefault();
setVisible(true); setVisible(true);
setRecord(record); setRecord(record);
}} }}