bramstein/knockout.selection — pull request #59 by mwoc (2013-07-31 09:53:57+00:00)
Title: Conditional rendering with an if binding

When the element to which knockout.selection is bound is rendered conditionally with a knockout 'if' binding (say only when more than x items are in the foreach), the subscription which cleans up the selection state is disposed microseconds before it's called, which leaves elements around in the selection, focused and anchor observable(array)s while they're not in the foreach anymore.

This pull request presents two failing tests for this, and a one-line fix which forces a state cleanup in the domNodeDisposal callback