Skip to content

Commit 86acabb

Browse files
committed
ACP2E-188:Added check for datacontext
1 parent a25a3a5 commit 86acabb

File tree

1 file changed

+8
-7
lines changed
  • app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings

1 file changed

+8
-7
lines changed

app/code/Magento/Ui/view/base/web/js/lib/knockout/bindings/datepicker.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,14 @@ define([
5454
});
5555
});
5656

57-
// Binding context value can be cleared by another component (such
58-
// as filters), make sure datepicker element value is cleared, too.
59-
bindingContext.$data.value.subscribe(function (newVal) {
60-
if (!newVal) {
61-
$(el).val('');
62-
}
63-
}, this);
57+
if(bindingContext.$data) {
58+
bindingContext.$data.value.subscribe(function (newVal) {
59+
if (!newVal) {
60+
$(el).val('');
61+
}
62+
}, this);
63+
}
64+
6465

6566
},
6667

0 commit comments

Comments
 (0)