Comments (4)
from dna-engine.
This bug is because the location of the template within the container is determined by simply looking at the index of the template relative to its siblings. This breaks if there are multiple templates at the same level within the same container.
The workaround is to wrap each template.
For example, replace:
<div id=book class=dna-template>
<p>Title: <span>~~title~~</span></p>
</div>
with:
<div class=books>
<div id=book class=dna-template>
<p>Title: <span>~~title~~</span></p>
</div>
</div>
Wrapping templates has as two advantages:
1) Performance, because dna.js does not have to calculate position within the container
2) Semantics, because multiple clones (plural) are closely related and should be in a group (singular)
Nonetheless, this bug needs to be fixed. The fix has been tested and will be released shortly. The fix involves making the location calculation of unwrapped templates smarter to keep track of templates further up in the DOM and adjust automatically as they are cloned.
from dna-engine.
The original test.txt
running with the old dna.js v1.3.7:
https://jsfiddle.net/bwrbch25/7
...and with the new dna.js v1.3.8:
https://jsfiddle.net/bwrbch25/8
from dna-engine.
Release v1.3.8
from dna-engine.
Related Issues (20)
- Replace deprecated assert.deepEqual() in spec/package.js HOT 2
- Replace deprecated assert.deepEqual() in spec/utils.js HOT 1
- Switch to trailing comma style for multiline arrays and objects in spec/dom.js HOT 1
- Switch to ES6 object method shorthand in spec/visual.html HOT 3
- Switch to ES6 object method shorthand for the array module in dna.js HOT 2
- Switch to object method shorthand for the pageToken module
- Add singleGroups rule to jshint to catch unnecessary grouping operator
- Switch to ES6 object method shorthand in dna.js
- Add error checking for missing data parameter HOT 3
- Upgrade to ES6 spread operator to merge options HOT 1
- Add support in the dna.events module for focus and blur HOT 1
- Switch to trailing comma style for multiline arrays in: spec/array.js
- Create dna.templateExists() function in dna.js
- Add JSHint rule to disallow var declarations HOT 1
- Switch to ES6 object method shorthand for top-level functions HOT 1
- Replace deprecated assert.deepEqual() in spec/arrays.js HOT 2
- Replace deprecated $.trim() function
- Replace deprecated assert.deepEqual() in spec/dom.js
- Add JSHint rule to disallow invalid space characters
- Switch to trailing comma style for multiline arrays and objects in spec/arrays.js
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dna-engine.