From 0083f04c7de32856b677f5fd4af8027cde799713 Mon Sep 17 00:00:00 2001 From: Edgars Kohs Date: Sun, 7 May 2017 17:31:31 +0700 Subject: [PATCH] When an element that has been connected to datetimepicker object has been dynamically removed due to dynamic content changes the javascript starts throwing errors on window resize events regarding getComputedStyle receiving nulls in its 0 argument. Re-check the value before calling resolves the issue. --- jquery.datetimepicker.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/jquery.datetimepicker.js b/jquery.datetimepicker.js index 73f8d12..3c96e62 100755 --- a/jquery.datetimepicker.js +++ b/jquery.datetimepicker.js @@ -2001,6 +2001,10 @@ dateInputHasFixedAncestor = false; forEachAncestorOf(dateInputElem, function (ancestorNode) { + if (ancestorNode === null) { + return false; + } + if (options.contentWindow.getComputedStyle(ancestorNode).getPropertyValue('position') === 'fixed') { dateInputHasFixedAncestor = true; return false;