-
Notifications
You must be signed in to change notification settings - Fork 604
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
fix(camera): Allow cancelation of sheet in Web #2284
base: main
Are you sure you want to change the base?
fix(camera): Allow cancelation of sheet in Web #2284
Conversation
To be aligned with Android and iOS platforms
The reason why it's not cancelable on web is because pwa-elements action sheet doesn't provide any event to indicate the cancelation, so allowing to cancel the action sheet will make the camera plugin call to hang as it won't reject nor resolve. So for making the prompt cancelable, pwa-elements action sheet should be updated to emit an event on the cancellation and in camera plugin listen for that event to reject the call with an error as iOS and Android do. |
@jcesarmobile -> opened a PR for pwa-elements to add an event listener for when the action sheet is dismissed - ionic-team/pwa-elements#138 Then, in this PR, will add the equivalent cancelation that's already present on native Android and iOS. actionSheet.addEventListener('onCanceled', async () => {
reject(new CapacitorException('User cancelled photos app'));
}) |
The
actionSheet
prompt was previously not cancellable in Web, even though it is cancellablesetCancelable(false)
not called, by default it is cancelableUIAlertAction
with stylecancel
allows sheet to be canceled when clicking outside.This PR fixes that.
Addresses #2241 and ionic-team/pwa-elements#134