diff --git a/camera/src/web.ts b/camera/src/web.ts index 10e7e3fad..1870d1a03 100644 --- a/camera/src/web.ts +++ b/camera/src/web.ts @@ -23,7 +23,7 @@ export class CameraWeb extends WebPlugin implements CameraPlugin { document.body.appendChild(actionSheet); } actionSheet.header = options.promptLabelHeader || 'Photo'; - actionSheet.cancelable = false; + actionSheet.cancelable = true; actionSheet.options = [ { title: options.promptLabelPhoto || 'From Photos' }, { title: options.promptLabelPicture || 'Take Picture' }, @@ -36,6 +36,9 @@ export class CameraWeb extends WebPlugin implements CameraPlugin { this.cameraExperience(options, resolve, reject); } }); + actionSheet.addEventListener('onCanceled', async () => { + reject(new CapacitorException('User cancelled photos app')); + }); } else { this.cameraExperience(options, resolve, reject); }