I have an issue where I have an afterAdd event firing which hide()'s and then slideDown()'s an item in a knockout template. This works great except for the fact that inside of template I have some code which checks to see if the item is selected. The code is:
<script type="text/html" id="sidebarTemplate">
<li class="sidebar-list-item" data-bind="css: { selected: ($item.selectedId() == _id) }">
<a href="#" data-bind="text: msg.en_US, click: $item.selectItem"></a>
</li>
I get an error in chrome which says: Cannot set property 'display' of undefined
I did some digging and this is because jQuery is trying to hide() <!---->. When I get rid of the data-bind="css: ..." it all works fine. I think it has to do with the fact that it takes a bit of time to evaluate that, but I am not sure.