Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

open crop modal with defaultFileList props #287

Open
tomasnikl opened this issue May 3, 2024 · 4 comments
Open

open crop modal with defaultFileList props #287

tomasnikl opened this issue May 3, 2024 · 4 comments

Comments

@tomasnikl
Copy link

tomasnikl commented May 3, 2024

Hi,

is it possible to open a modal for cropping automatically if only one file is defined in defaultFileList?

<ImgCrop aspect={aspect}>
	<Upload.Dragger
		accept={accept}
		defaultFileList={[{
			uid: 'foo1',
			name: 'foo1.png',
			status: 'done',
			url: 'https://example.com/image.png',
			thumbUrl: 'https://example.com/image.png',
		}]}
	>
		Click/Drag to upload
	</Upload.Dragger>
</ImgCrop>

the reason is the following:
I know the url of the image when I load the component and I want to crop this image

@nanxiaobei
Copy link
Owner

nanxiaobei commented May 7, 2024

I think you can directly do it like this in current version?

@RezaGhx
Copy link

RezaGhx commented May 8, 2024

hey @nanxiaobei
I wanna report an issue but my time is running out. your onModalCancel is uploading the image anyway, as it should close the cropper modal only. do you know how to fix it?

@du937935598
Copy link

After popping up the cropping, drag and zoom in, then click the button to shrink it. It cannot be shrunk to 1, but can only be shrunk to 1.1. What should I do

@nanxiaobei
Copy link
Owner

onModalCancel will ignore the upload

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants