Solved multiple canvas issue#248
Open
TonyWhite wants to merge 1 commit into
Open
Conversation
If el is already populate, it makes duplicate childs that can't fit in original geometry. I added row 360 with this code to avoid the bug. el.innerHTML = ""; Scenario for multiple canvas issue on Codepen https://codepen.io/tonywhite1985/pen/bGgedMN?editors=1000 Try to comment this in JS tab on row 918 el.innerHTML = ""; and see glithes. 1) Open RESULT tab and start typing some text to encode 2) Detele all text 3) Try to type another text to encode 4) See qrcode (it shows badly when el.innerHTML = ""; is under comment)
Author
|
I have improved the modularity of my scenario. Now, if you delete el.innerHTML = "", the glitch is immediately visible. |
Contributor
|
This would solve it for your use case without needing to changing the library. Clear the element where the qr code is added before you call the method to add the qr code: |
Author
|
@markvantilburg it was my first step to solving the glitch. However the library adds a child without deleting or checking if another one already exists. I think it is useful to limit human errors by simplifying routine maintenance. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If el is already populate, it makes duplicate childs that can't fit in original geometry.
I added row 360 with this code to avoid the bug.
el.innerHTML = "";
Scenario for multiple canvas issue on Codepen
https://codepen.io/tonywhite1985/pen/bGgedMN?editors=1000
Try to comment this in JS tab on row 918
el.innerHTML = "";
and see glithes.