-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #3321. Only let dom-repeat insert elements in attached if it ha…
…s been previously detached; correctly avoid re-adding children in document fragments to an element's logical linked list if they are already there.
- Loading branch information
Steven Orvell
committed
Jan 23, 2016
1 parent
55b91b3
commit 9f2464d
Showing
4 changed files
with
120 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
|
||
<title>distribute dom-repeat</title> | ||
|
||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
|
||
<script src="../../../webcomponentsjs/webcomponents-lite.js"></script> | ||
<link rel="import" href="../../polymer.html"> | ||
|
||
</head> | ||
<body> | ||
|
||
|
||
<dom-module id="x-container"> | ||
<template> | ||
<content select="*"></content> | ||
</template> | ||
<script> | ||
Polymer({ | ||
is: 'x-container' | ||
}) | ||
</script> | ||
</dom-module> | ||
|
||
|
||
<dom-module id="x-test"> | ||
<template strip-whitespace> | ||
<x-container id="container"> | ||
<template class="foo" id="nug" is="dom-repeat" items="{{model}}"> | ||
<div class="foo">{{item.id}}</div> | ||
</template> | ||
</x-container> | ||
</template> | ||
<script> | ||
Polymer({ | ||
is: 'x-test', | ||
|
||
ready: function() { | ||
this.model = [ | ||
{id: '1', text: 'How much do you like food?'}, | ||
{id: '2', text: 'Where do you buy your groceries?'}, | ||
{id: '3', text: 'What is your favourite colour?'} | ||
]; | ||
Polymer.dom.flush(); | ||
var self = this; | ||
console.log(Polymer.dom(self.$.container).firstElementChild); | ||
setTimeout(function() { | ||
console.log('***'); | ||
console.log(Polymer.dom(self.$.container).firstElementChild); | ||
}, 100); | ||
} | ||
}) | ||
</script> | ||
</dom-module> | ||
|
||
<x-test></x-test> | ||
|
||
</body> | ||
</html> |
This file contains 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