Skip to content

Commit 67172c7

Browse files
committed
fix(ui): add stopPropagation to upload-action
1 parent 22c1f9e commit 67172c7

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

packages/ui/src/components/upload/UploadAction.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ function UploadAction(props: DUploadActionProps, ref: React.ForwardedRef<any>):
5151
href={__file.url}
5252
title={restProps.title ?? t('Upload', 'Preview file')}
5353
onClick={(e) => {
54+
restProps.onClick?.(e);
55+
56+
e.stopPropagation();
5457
if (!isUndefined(defaultAction)) {
5558
e.preventDefault();
5659

@@ -70,6 +73,7 @@ function UploadAction(props: DUploadActionProps, ref: React.ForwardedRef<any>):
7073
onClick={(e) => {
7174
restProps.onClick?.(e);
7275

76+
e.stopPropagation();
7377
if (!isUndefined(defaultAction)) {
7478
defaultAction(__file);
7579
} else {
@@ -89,6 +93,7 @@ function UploadAction(props: DUploadActionProps, ref: React.ForwardedRef<any>):
8993
onClick={(e) => {
9094
restProps.onClick?.(e);
9195

96+
e.stopPropagation();
9297
__onRemove?.();
9398
}}
9499
title={restProps.title ?? t('Upload', 'Remove file')}
@@ -101,6 +106,11 @@ function UploadAction(props: DUploadActionProps, ref: React.ForwardedRef<any>):
101106
ref={ref}
102107
className={getClassName(restProps.className, `${dPrefix}upload__item-action`)}
103108
type={restProps['type'] ?? 'button'}
109+
onClick={(e) => {
110+
restProps.onClick?.(e);
111+
112+
e.stopPropagation();
113+
}}
104114
>
105115
{children}
106116
</button>

0 commit comments

Comments
 (0)