dift's Issues
Incorrect move pos detection
I have a case for a list of 10 elements, swapping list[1] and list[8] to each other
var tmp = list[1]
list[1] = list[8]
list[8] = tmp
Library incorrectly detects everything between 1 and 8 idx as moved and produces 8 MOVE effects, with prev = next for [2-7] elements.
Elements in between has the same indices and it should produce UPDATE for them.
Current position
I'm using dift in Deku now because it's way easier and way less broken :)
In the spirit of keeping things pure, I'm trying to avoid needing to store the DOM element on the vnode and just using indexes. It's a little hard to do with the current move effect because it only passes in the position where it needs to be moved to, and not where it needs to be moved from.
It'd be kind of nice to have something like:
function effect (type, prev, next, pos, prevPos) {
// blah
}
That way I could just move the element in the DOM using it's current index rather than storing the vnode. You'd need to be keeping track of the current state of the list, but you know the code way better than me. If you can point me in the right direction, and this is something you'd like, I'm happy to open a PR.
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.