You need to make sure that you are handling the hidden
modal event so that you can clear the observable. Then, the next time you set it to true
, it will notify all subscribers as it has actually changed (observables do not report when their value is set to the same value).
Something like this in your init:
init: function (element, valueAccessor) { $(element).on("hidden", function() { valueAccessor()(false); }); },
If necessary, you can use ko.isWriteableObservable
to determine if the value passed to the binding is actually observable, which you can write.
source share