Closed aaronchilcott closed 10 years ago
Great catch. That was actually a poor workaround for avoiding DOM reflows. I'll change that to use a document fragment swap.
Cool, this should be fixed in commit 570dbb9. The original methodology was using the display of the parent element to avoid document reflows, which led to the issue you reported. That was definitely not the best solution to that problem. I've change the methodology to use a document fragment for the view reshuffling, and no longer touch the parent element's display.
Nice work, thanks!
If a value of an bound object is changed, epoxy seems to reset the associated view's bindings, which then triggers the hide()/show() calls for (collection) bound elements. This eventually causes the elements to become visible, when perhaps they should have stayed hidden.
Following, are the line numbers which I believe to be causing this behaviour.
Does not first check the display state of the element before hiding.
Does not check if the element was initially hidden before binding.
I believe something like the following could be a viable solution, if this behaviour is unintended: https://github.com/gmac/backbone.epoxy/blob/master/backbone.epoxy.js#L623