Skip to content

fix(camera): reject promise on web input cancel event#1958

Merged
jcesarmobile merged 4 commits intoionic-team:mainfrom
andrzejSulkowski:pwa-camera-update
Dec 14, 2023
Merged

fix(camera): reject promise on web input cancel event#1958
jcesarmobile merged 4 commits intoionic-team:mainfrom
andrzejSulkowski:pwa-camera-update

Conversation

@andrzejSulkowski
Copy link
Copy Markdown
Contributor

@andrzejSulkowski andrzejSulkowski commented Dec 10, 2023

This PR adds promise rejections for the pwa camera plugin upon cancelation of the input element.

Previously, in the web implementation of the PWA camera plugin, the promise would remain unresolved if the user cancelled the input, as it was solely reliant on the 'change' event. This behaviour differed from the iOS/Android implementation, where the promise is rejected under similar circumstances.

closes #1050

Copy link
Copy Markdown
Member

@jcesarmobile jcesarmobile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR, I've fixed some lint issues, next time you can run npm run fmt and it will fix the issues automatically.

cancel event is pretty new, so it will only fix the issue for new browsers, but that's better than nothig

@jcesarmobile jcesarmobile changed the title feat(pwa camera): reject promise on input cancel fix(camera): reject promise on web input cancel event Dec 13, 2023
@jcesarmobile jcesarmobile merged commit d218ba6 into ionic-team:main Dec 14, 2023
jcesarmobile added a commit that referenced this pull request Dec 14, 2023
Co-authored-by: jcesarmobile <jcesarmobile@gmail.com>
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

Successfully merging this pull request may close these issues.

@capacitor/camera pickImages cancellation is not catched in web

2 participants