In KO 3.0 the bindings are Independent and ordered. You can read more about this here, and this should be considered a "breaking change", from the above linked example:
v2.x’s behavior about dependencies between bindings (described in the
section about “Independent and ordered bindings” above), is an
undocumented internal implementation detail so hopefully you aren’t
relying on it. But if you are relying on that then obviously you will
see a change of behavior because bindings are independent in v3 by
design. You’ll need to stop relying on cross-binding dependencies,
which by the way will make your code much cleaner and easier to
understand.
So you binding is not working anymore because it assumed that when your comment
property is changed it fires also your limitCharacters
binging altough your limitCharacters
binding has nothing to do with the comment
property.
One possible solution for fixing this that you need to explicitly declare a dependency on the value
binding in your update
handler by acessing its value with allBindingsAccessor().value();
:
ko.bindingHandlers.limitCharacters = {
update: function(element, valueAccessor, allBindingsAccessor, viewModel)
{
var val = allBindingsAccessor().value();
allBindingsAccessor().value(val.substr(0, valueAccessor()));
}
};
Demo JSFiddle.