Skip to content

Commit

Permalink
pass resolve to onModalCancel
Browse files Browse the repository at this point in the history
  • Loading branch information
nanxiaobei committed Nov 6, 2023
1 parent db0e629 commit 3149f7e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/ImgCrop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ const ImgCrop = forwardRef<CropperRef, ImgCropProps>((props, cropperRef) => {
easyCropRef.current!.onReset();

resolve(AntUpload.LIST_IGNORE);
cb.current.onModalCancel?.();
cb.current.onModalCancel?.(resolve);
};

// on modal confirm
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export type ImgCropProps = {
modalOk?: string;
modalCancel?: string;
onModalOk?: (value: BeforeUploadReturnType) => void;
onModalCancel?: () => void;
onModalCancel?: (resolve: (value: BeforeUploadReturnType) => void) => void;
modalProps?: Omit<
ModalProps,
| 'className'
Expand Down

0 comments on commit 3149f7e

Please sign in to comment.