Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IBX-7804: Fix dropdown offsetHeight error when ibexa-main-header not present #1183

Merged
merged 1 commit into from
Mar 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/bundle/ui-dev/src/modules/common/dropdown/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Copy link
Contributor Author

@tischsoic tischsoic Feb 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: ibexa-main-header offset was introduced to avoid dropdown popup overlap with the header (screenshots below). If there is no header there is no need to avoid overlap.
Credit: screenshots taken by @GrabowskiM


itemsStyles.top = top - ITEMS_LIST_WIDGET_MARGIN;
itemsStyles.maxHeight = top - headerHeight - ITEMS_LIST_SITE_MARGIN;
Expand Down
Loading