Open ksirmons opened 7 years ago
Checking _deferUpdates
will only work if using the debug version of Knockout. I'm not sure if there's a way to check in all cases.
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