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

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

Merged
merged 4 commits into from
Dec 14, 2023
Merged

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

merged 4 commits into from
Dec 14, 2023

Conversation

andrzejSulkowski
Copy link
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
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
11 of 12 checks passed
jcesarmobile added a commit that referenced this pull request Dec 14, 2023
Co-authored-by: jcesarmobile <jcesarmobile@gmail.com>
LaravelFreelancerNL pushed a commit to dennis-wedevise/capacitor-plugins that referenced this pull request Dec 19, 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