diff --git a/build/css/tempusdominus-bootstrap-4.css b/build/css/tempusdominus-bootstrap-4.css index 01245a4..cd1384e 100644 --- a/build/css/tempusdominus-bootstrap-4.css +++ b/build/css/tempusdominus-bootstrap-4.css @@ -20,7 +20,7 @@ display: block; margin: 2px 0; padding: 4px; - width: 12.8vw; } + width: 12.8rem; } @media (min-width: 576px) { .bootstrap-datetimepicker-widget.dropdown-menu.timepicker-sbs { width: 38em; } } diff --git a/src/js/tempusdominus-bootstrap-4.js b/src/js/tempusdominus-bootstrap-4.js index 8f9e031..c605e9f 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({