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

side effects of 'each' and 'options' together #126

Closed
Kanaye opened this issue Jan 6, 2016 · 2 comments
Closed

side effects of 'each' and 'options' together #126

Kanaye opened this issue Jan 6, 2016 · 2 comments
Labels

Comments

@Kanaye
Copy link
Collaborator

Kanaye commented Jan 6, 2016

Look at the selects or click the "reset" button and look at the browsers console 😞.
https://jsfiddle.net/h19tftc7/3/

@Kanaye
Copy link
Collaborator Author

Kanaye commented Jan 6, 2016

Hmm that's an interesting problem and hard to explain (at least for me).
Let's try it:
We are calling the options-preprocess-function for each cycle of the each-data-query.
And we are adding the caption every time as a child-element (here).
But we are only testing for data-role="header" the first time (here) so the other children don't get rendered as header but as normal children.
Here the example updated to show that behaviour.

We can't skip the execution of preprocess cause the options parameter could be a property of the each-data-query. Also we can't "kill" the _headers as we need them in the update-function.

I don't have a clean solution (yet).

@astoilkov astoilkov added the bug label Jan 28, 2016
Kanaye added a commit that referenced this issue Jan 25, 2017
Will be necessary to clone the _template for #126.
@Kanaye Kanaye closed this as completed in 1fbbb8d Jan 25, 2017
@Kanaye
Copy link
Collaborator Author

Kanaye commented Jan 25, 2017

Finally fixed this 🎉.

That was harder than I imagined when I started to work on this issue again a month ago.
Had 3 nearly working approches, one of them totally overengineered 😆

The acctual fix will have some negative impact on performance because we are now cloning the _template for each iteration in the each-data-query to the iterations state.

I think it's not that big of deal bacause the VirtualElements aren't that hard to clone and we currently have time/memory-havier things to work on, but I have it on my things-to-think-over-again-list.

Also I think a a little slower but working approach should be prefered over a bugged version.

Just as some things that should be noted in my opinion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants