From 178b9ef621f6b8f9c3940222e00db23e4e8bcfcd Mon Sep 17 00:00:00 2001 From: Jakub Brzegowski Date: Wed, 13 Mar 2024 11:08:49 +0100 Subject: [PATCH] IBX-7804: Fix dropdown offsetHeight error when ibexa-main-header not present (#1183) --- src/bundle/ui-dev/src/modules/common/dropdown/dropdown.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bundle/ui-dev/src/modules/common/dropdown/dropdown.js b/src/bundle/ui-dev/src/modules/common/dropdown/dropdown.js index 90f5b61622..fa29aea84d 100644 --- a/src/bundle/ui-dev/src/modules/common/dropdown/dropdown.js +++ b/src/bundle/ui-dev/src/modules/common/dropdown/dropdown.js @@ -106,7 +106,7 @@ const Dropdown = ({ itemsStyles.maxHeight = window.innerHeight - bottom - ITEMS_LIST_SITE_MARGIN; } else { const headerContainer = document.querySelector('.ibexa-main-header'); - const headerHeight = headerContainer.offsetHeight; + const headerHeight = headerContainer?.offsetHeight ?? 0; itemsStyles.top = top - ITEMS_LIST_WIDGET_MARGIN; itemsStyles.maxHeight = top - headerHeight - ITEMS_LIST_SITE_MARGIN;