-
-
Notifications
You must be signed in to change notification settings - Fork 103
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
Blocks is inserting the wrong text in the wrong node #104
Comments
Short update: |
Let me guess. This is caused from the |
The main reasons is that observables are inserting a comment when rendered with an expression.
will get rendered to something like:
That are 3 nodes. Unfortunatly I've been busy and felt a little bit sick the last days and didn't came around to work on this. |
Yeah. I have seen this. The main challenge is to find out how many elements to skip and which to update. There should be a mechanism which detects what type of expression is the element. |
Okay. I have a solution or at least some parts of it. test:{{someObservable}}|some static Rendered with test:
<!--5:blocks-->
test-observable|some static will result in: ['test:',
null, /* maybe the comment content here as it's (most likely) an other observable in case of Observable([]).reset() */,
'test-observable|some static'] with [edit:] I have to speed up some stuff and some cacheing mechanisms aren't working currently. blocks.query({
test: 'normal string'
});
blocks.query({ // In this case I would not have the right node value
test: blocks.observable('and now I have a problem')
}); And I may have some other cases where the new rendering fails. [edit: typos and brought some words in the right order] |
Added an rendering type Expression.NodeWise that will return an array with the values positioned in the order of the node when passed to Expression.GetValue. Expressios objects now have a property nodeLength and chunks of expressions now have an array nodePositions containing the the position of the nodes the expression updates. Updated VirtualElement.syncChildren to delete all nodes related to an expression and to update all nodes of an expression with a changed value.
Updating/Insetring of wrong nodes fixed. Closes #104
Blocks is
updatinginserting into the wrong text-node in aneach
data-query in thereset()
- function of array-observables, when these get reset the first time.To be clear: http://jsfiddle.net/bpkvse3r/1/ click the reset button at least 3 times.
Will look into this this tomorrow.
[edit:]
Correcting myself: The update is on the right node. The initial insert is on the wrong one.
The text was updated successfully, but these errors were encountered: