fix: clean up buttons on widget destroy for extended slider on wearables#465
Open
orcema wants to merge 1 commit intoSamsung:tau_1.0from
Open
fix: clean up buttons on widget destroy for extended slider on wearables#465orcema wants to merge 1 commit intoSamsung:tau_1.0from
orcema wants to merge 1 commit intoSamsung:tau_1.0from
Conversation
pkaczmarczy
suggested changes
Nov 12, 2019
| * @member ns.widget.wearable.Slider | ||
| */ | ||
| prototype._removeButtons = function (element) { | ||
| var buttonsContainer = document.querySelector("div .ui-slider-buttons"); |
Collaborator
There was a problem hiding this comment.
Hi,
Such selector (on "document") may cause problems, TAU pages are build within the same "document" and such selector may select buttons from different page.
I think that best option is to use this._ui dict to store reference to buttons container after it is build (_buildButtons method) and remove it here if it exists.
TomaszLukawskiSam
requested changes
Nov 18, 2019
| element.parentElement.insertBefore(buttonsContainer, element); | ||
| }; | ||
|
|
||
| /** |
Contributor
There was a problem hiding this comment.
This change should be applied to /src/js/profile/wearable/widget/wearable/Slider.js.
The dist folder is overriden with each build.
I agree with @pkaczmarczy about store the buttonsContainer in this._ui object.
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.
[Problem]
Extended slider on wearable does't clean up buttons on widget destroy. Thus each time the widget is recreated new buttons appear and finally buttons are cloned as many times as the widget has been created.
Steps for reproducing the issue:
Here below a screenshot of a widget created 3 times (browser load/unload page)
