diff --git a/src/packages/dialog/dialog.taro.tsx b/src/packages/dialog/dialog.taro.tsx index 0749e4a40..ad4acddda 100644 --- a/src/packages/dialog/dialog.taro.tsx +++ b/src/packages/dialog/dialog.taro.tsx @@ -125,7 +125,7 @@ export const BaseDialog: FunctionComponent> & { (footerDirection === 'vertical' ? ( handleCancel(e)} + onClick={(e) => handleCancel(e as any)} > {cancelText || locale.cancel} diff --git a/src/packages/dialog/dialog.tsx b/src/packages/dialog/dialog.tsx index 62149fea1..b6af7e73f 100644 --- a/src/packages/dialog/dialog.tsx +++ b/src/packages/dialog/dialog.tsx @@ -64,7 +64,9 @@ const BaseDialog: ForwardRefRenderFunction> = ( const renderFooter = () => { if (footer === null) return '' - const handleCancel = (e: MouseEvent) => { + const handleCancel = ( + e: MouseEvent + ) => { e.stopPropagation() if (!beforeCancel?.()) return if (!beforeClose?.()) return