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: Remove style attribute from body for prevent unexpected backgrou… #1

Merged
merged 1 commit into from
Sep 5, 2022

Conversation

alfonso-salces
Copy link
Collaborator

…nds.

@@ -38,9 +38,6 @@ function clearBackground() {
if (body.style) {
body.style.backgroundColor = 'rgba(0,0,0,0.01)';
body.style.backgroundImage = '';
setTimeout(function() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is it necessary to remove this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Is not required remove that, I found other solution.

@@ -159,6 +156,9 @@ return {
},
destroy: function(callback) {
cordova.exec(doneCallback(callback, true), null, 'QRScanner', 'destroy', []);
setTimeout(function() {
document.body.removeAttribute('style');
Copy link
Collaborator

Choose a reason for hiding this comment

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

Instead of removing all the styles, would it be feasible to just clear the ones updated by this plugin? Maybe we should even store the initial values if they were set on the body. I don't think any of this is too likely to happen, but it's a more robust implementation and when working with plugins you never know how they'll interact with other plugins.

package.json Outdated
@@ -1,6 +1,6 @@
{
"name": "@moodlehq/cordova-plugin-qrscanner",
"version": "3.0.1-moodle.2",
"version": "3.0.1-moodle.3",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Instead of bumping the version number here, we should do it on a separate release commit. Other than that, I think this is a good candidate to contribute to the original plugin at https://github.com/bitpay/cordova-plugin-qrscanner, so you could open a PR there and then add it to this repo so that we don't have to wait for them to merge it. This is the same we did with bitpay#266 as documented in the README.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@alfonso-salces alfonso-salces force-pushed the dev branch 2 times, most recently from 0ba938a to 5c2825a Compare August 18, 2022 13:03
@NoelDeMartin NoelDeMartin merged commit 03d34ca into moodlemobile:master Sep 5, 2022
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.

2 participants