You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When observableArray is extended to be deferred like ko.observableArray([]).extend({ deferred: true }); some items disappear from GUI when dropped.
This is happening in knockout 3.4.2.
Found code in knockout-sortable where it checks for deferUpdates and runs ko.tasks.runEarly(); but this checks if all of knockout is being deferred, not a single observable array being extended to be deferred.
Changing the if statement if (ko.options && ko.options.deferUpdates) { ko.tasks.runEarly(); }
to
if ((ko.options && ko.options.deferUpdates) || (sourceParent && sourceParent._deferUpdates)) { ko.tasks.runEarly(); }
fixes the issue for me.
Keith
The text was updated successfully, but these errors were encountered:
ksirmons
added a commit
to ksirmons/knockout-sortable
that referenced
this issue
May 4, 2017
Would it hurt to just run ko.tasks.runEarly(); every time, and not check for 'if deferUpdates'? if (typeof ko.tasks.runEarly === "function") { ko.tasks.runEarly(); }
When observableArray is extended to be deferred like
ko.observableArray([]).extend({ deferred: true });
some items disappear from GUI when dropped.This is happening in knockout 3.4.2.
Found code in knockout-sortable where it checks for deferUpdates and runs
ko.tasks.runEarly();
but this checks if all of knockout is being deferred, not a single observable array being extended to be deferred.Changing the if statement
if (ko.options && ko.options.deferUpdates) { ko.tasks.runEarly(); }
to
if ((ko.options && ko.options.deferUpdates) || (sourceParent && sourceParent._deferUpdates)) { ko.tasks.runEarly(); }
fixes the issue for me.
Keith
The text was updated successfully, but these errors were encountered: