Avoid deleting the HTML node when destroying ViewWrapper instance and set visible state correctly #337
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.
ViewWrapper deletes its own node from the DOM
for a description, please see the linked ticket
please test this behavior in your applications if it has any side-effects.
but as far as I can see it shouldn't. the current behavior of our detail views is that the ViewWrapper instances are created once and then the detail views are only shown and hidden via a CSS class.
but
node
of those instances should not be deleted, because theViewWrapper
class is only instantiated when the detail view chooser is built.as far as I can see the
destroy
method of theViewWrapper
class was never called in the projects I have set up locallyEdit:
another option would be to insert the HTML node again into the DOM, because we still have the reference to it in
this.node
Visible state is kept when destroying the instance
by setting the
visible
attribute of the ViewWrapper instance back to false we avoid recrating a view when we click on the centra LineUp table. see https://github.com/datavisyn/tdp_core/blob/develop/src/base/ViewWrapper.ts#L298-L300