-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
No "cancel cropper" error callback #1540
Comments
It provides an error callback when attempting to cancel. example
you can optionally bring in the list of codes as well |
@socialcode-rob1 No, the error callback is not called. I have the same problem. The In my case, I can make work my way around this by displaying a cancel button on the view underneath, which the user can press to reset the state. This works because the cropper view actually disappears, although the callback is not called. |
"react-native-image-crop-picker": "0.36.2" I can confirm that the error callback is not called when cancelling the cropper from both openCamera and openPicker in iOS. When using openPicker, cancelling the cropper results in the library being displayed. Then cancelling the library does fire the error callback, so we eventually get there. But... from the cropper itself, no error callback. The openCamera does not have that fallback point. The cancel button on the cropper closes both the cropper and the openCamera, but with no callback. The error callback does appear to be called when cancelling the cropper in Android. My workaround is to disable the cropper on both openCamera and openPicker.
I then call the image cropper after the image is captured or selected:
There is a "flash" between the image selection and the cropper loading, but with some creative styling I was able to make that fairly unobtrusive. This "works"... but is a pretty heavy workaround |
dont use "then and catch", u can make a clean code as follows:
u can see "cancel by user" in catch |
You can update code in ImageCropPicker.m
and use try catch
|
Great find! Maybe you could submit a PR on this, @dinhbt? And a markdown tip: Use This line has not been changed
+This line has been added and is green
-This line is removed Just write
|
try, catch works for me! |
Version
Tell us which versions you are using:
Platform
Tell us to which platform this issue is related
Expected behaviour
Error is reported when cropper is cancelled
E_CROPPER_CANCELLED
Actual behaviour
No error is reported and the
await
never resolves.Steps to reproduce
Take a photo on iOS
Press "Cancel" on the cropper screen
The error callback nor the
then
callback is resolved.Attachments
The text was updated successfully, but these errors were encountered: