Failed to execute 'getComputedStyle' on 'Window'
Using datetimepicker in a modal popup window with angularjs and after I save a datetime and close the modal popup I am getting this error:
Uncaught TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'.: at document path 'http://localhost:52970/Home/Index'.
at anonymous('Uncaught TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'.', 'http://localhost:52970/scripts/plugins/jquery-datetimepicker/jquery.datetimepicker.full.js', '2582', '18', 'TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'.')
I am wrapping the datetimpicker in an angular directive like this.
(function() {
"use strict";
angular
.module("app.utils")
.directive("datetimepicker",
function () {
return {
restrict: "EA",
require: "ngModel",
scope: {
setMin: "=",
setMax: "=",
min: "=",
max: "=",
time: "="
},
link: function (scope, elem, attr) {
scope.options = {
dayOfWeekStart: 1,
format: "d.m.Y H:i",
formatTime: "H:i",
formatDate: "d.m.Y",
weeks: true
};
elem.on("focus", function (e) {
if (scope.min && scope.setMin) {
scope.options.minDate = scope.min;
}
if (scope.max && scope.setMax) {
scope.options.maxDate = scope.max;
}
if (scope.time === false) {
scope.options.format = "d.m.Y";
scope.options.timepicker = false;
}
$(elem).datetimepicker(scope.options);
}).datetimepicker(scope.options);
}
}
});
})();
Any ideas?
También sucede un error similar cuando recargo un div que contiene un datetimepicker: "Argument 1 of Window.getComputedStyle is not an object."
This problem occurs to us as well. https://github.com/xdan/datetimepicker/blob/master/jquery.datetimepicker.js#L2004
It happens on old Chrome browsers for Desktop but also on new Chrome for Android as well.
If merged should resolve issue in general. https://github.com/xdan/datetimepicker/pull/574
Do we have any update on the above issue?