Fix templateStrategy removeBuffers to check whether parent contains elements before removing#201
Open
nyxtom wants to merge 2 commits intoaurelia:masterfrom
Open
Fix templateStrategy removeBuffers to check whether parent contains elements before removing#201nyxtom wants to merge 2 commits intoaurelia:masterfrom
nyxtom wants to merge 2 commits intoaurelia:masterfrom
Conversation
…ents before removing
Fix template default strategy to check for buffer elements on detatch
Member
|
@nyxtom thanks for this PR. This probably only happens when there's some html mutation outside of Aurelia context, and results in the elements being removed without signalling the virtual repeater. Maybe we can do this, I'm a bit hesitant to add this defensive code though, can you describe the issues you are seeing a bit more? |
Author
|
I’m currently using it within a tree view control which has nested virtual repeats according their children. It’s a bit of an odd situation but it involves using a custom template in a slot and binding it in through the aurelia processContent behavior. I can’t seem to code around it without adding this fail safe at the moment unfortunately tree-view.html tree-view-node.html tree-view-node.js tree-view-node-template.js |
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.
It's possible to run into an error where detaching the virtual repeat will lose context of the bottom and top buffer elements (due to underlying conditional changes possibly). As a result, the templateStrategy.removeBuffers will throw an error when you attempt to call removeChild when the element is not a child of the given parent element.