Is there a best-practice with knockout.js and/or CSS to prevent the extra divs that get created inside a foreach loop from displaying their extra whitespace height in the browser?
Source:
<div data-bind="foreach: jobs" >
<div data-bind="if: JobPhase.Id() == 3">
<div data-bind="text: JobPhase.Id"></div>
</div>
</div>
Result:
<div data-bind="if: JobPhase.Id() == 3"></div>
<div data-bind="if: JobPhase.Id() == 3"></div>
<div data-bind="if: JobPhase.Id() == 3"></div>
<div data-bind="if: JobPhase.Id() == 3">
//This one matched so it will display the content.
</div>
The first three items did not match but I'm still seeing their whitespace. Thoughts?