diff --git a/src/js/tempusdominus-bootstrap-4.js b/src/js/tempusdominus-bootstrap-4.js
index <HASH>..<HASH> 100644
--- a/src/js/tempusdominus-bootstrap-4.js
+++ b/src/js/tempusdominus-bootstrap-4.js
@@ -278,15 +278,15 @@ const TempusDominusBootstrap4 = ($ => { // eslint-disable-line no-unused-vars
                 self.widget.removeClass('float-right');
             }
 
-            // find the first parent element that has a static css positioning
-            if (parent.css('position') !== 'static') {
+            // find the first parent element that has a relative css positioning
+            if (parent.css('position') !== 'relative') {
                 parent = parent.parents().filter(function () {
-                    return $(this).css('position') === 'static';
+                    return $(this).css('position') === 'relative';
                 }).first();
             }
 
             if (parent.length === 0) {
-                throw new Error('datetimepicker component should be placed within a static positioned container');
+                throw new Error('datetimepicker component should be placed within a relative positioned container');
             }
 
             self.widget.css({
datetimepicker component should be placed within a relative positioned container