I ran into this issue again with the following example when hitting the clear button immediately. Strangely I got both examples to work by initializing the date observable differently: this.date = ko.observable(null);
<!doctype html>
<html>
<head>
<title>Essential Studio for JavaScript : Autocomplete - KnockOut</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" charset="utf-8" />
<link rel='nofollow' href="15.2.0.43/external/bootstrap.css" rel="stylesheet" />
<link rel='nofollow' href="//cdn.syncfusion.com/15.2.0.43/js/web/flat-azure/ej.web.all.min.css" rel="stylesheet" />
<link rel='nofollow' href="15.2.0.43/themes/web/content/default.css" rel="stylesheet" />
<link rel='nofollow' href="15.2.0.43/themes/web/content/default-responsive.css" rel="stylesheet" />
<script type="text/javascript" src="//cdn.syncfusion.com/js/assets/external/jquery-1.11.3.min.js"></script>
<script src="//cdn.syncfusion.com/js/assets/external/jquery.easing.1.3.min.js" type="text/javascript"></script>
<script type="text/javascript" src="//cdn.syncfusion.com/15.2.0.43/js/web/ej.web.all.min.js "></script>
<script src="15.2.0.43/scripts/web/properties.js" type="text/javascript"></script>
<script src="//cdn.syncfusion.com/js/assets/external/knockout.min.js" type="text/javascript"></script>
<script src="//cdn.syncfusion.com/15.2.0.43/js/common/ej.widget.ko.min.js" type="text/javascript"></script>
</head>
<body>
<form id="myForm">
<input data-bind='ejDatePicker: {value: date}' />
<input data-bind='value: date' />
<span>Your selection: <span data-bind="text: date"></span>
<button data-bind='click:clear'>Clear
</button>
</form>
<script type="text/javascript">
$(function () {
// declaration
var ViewModel = function () {
this.date = ko.observable();
var self = this;
self.clear = function(){
self.date(null);
};
};
var vm = new ViewModel()
ko.applyBindings(vm);
});
</script>
</body>
</html>