Skip to content
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

Binding on parent containing unnamed template child adds template to the wrong node #34

Closed
g105b opened this issue Nov 25, 2018 · 1 comment · Fixed by #229
Closed
Labels
Milestone

Comments

@g105b
Copy link
Member

g105b commented Nov 25, 2018

Example of bug:

<div id="container">
	<ul>
		<li data-template data-bind:text="content">Template element</li>
	</ul>
</div>
$document->getElementById("container")->bind([
	["content" => "One"],
	["content" => "Two"],
	["content" => "Three"],
]);

Actual result:

<div id="container">
	<ul>
	</ul>
	<li>One</li>
	<li>Two</li>
	<li>Three</li>
</div>

Expected result:

<div id="container">
	<ul>
		<li>One</li>
		<li>Two</li>
		<li>Three</li>
	</ul>
</div>

The problem is that when a parent is used to "bind", the parent node is where the new template children are appended. Instead, the original parent of the template should be used.

@g105b g105b added the bug label Nov 25, 2018
@g105b g105b added this to the v1 milestone Nov 25, 2018
@g105b g105b removed this from the v1 milestone Jul 27, 2019
@g105b g105b added this to the v2 milestone Sep 11, 2020
@g105b g105b mentioned this issue May 20, 2021
Merged
5 tasks
@g105b
Copy link
Member Author

g105b commented Sep 7, 2021

Fixed with facade model.

@g105b g105b closed this as completed Sep 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant