-
Notifications
You must be signed in to change notification settings - Fork 5
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
Conversation
@@ -38,9 +38,6 @@ function clearBackground() { | |||
if (body.style) { | |||
body.style.backgroundColor = 'rgba(0,0,0,0.01)'; | |||
body.style.backgroundImage = ''; | |||
setTimeout(function() { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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'); |
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0ba938a
to
5c2825a
Compare
…nds.