Skip to content

Commit

Permalink
Fix Run button position when datepicker is not visible (#7935)
Browse files Browse the repository at this point in the history
Signed-off-by: Suchit Sahoo <[email protected]>
  • Loading branch information
LDrago27 authored Aug 30, 2024
1 parent 6c7a5bb commit e5c125d
Showing 1 changed file with 10 additions and 21 deletions.
31 changes: 10 additions & 21 deletions src/plugins/navigation/public/top_nav_menu/top_nav_menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -202,31 +202,20 @@ export function TopNavMenu(props: TopNavMenuProps): ReactElement | null {

// Show the SearchBar in-place
default:
if (showDatePicker === TopNavMenuItemRenderType.IN_PORTAL) {
return (
<>
<MountPointPortal setMountPoint={setMenuMountPoint}>
<EuiFlexGroup alignItems="stretch" gutterSize="none">
<EuiFlexItem grow={false} className="osdTopNavMenuScreenTitle">
<EuiText size="s">{screenTitle}</EuiText>
</EuiFlexItem>
<EuiFlexItem grow={false}>{renderMenu(menuClassName)}</EuiFlexItem>
<EuiFlexItem className="globalDatePicker">
<div ref={datePickerRef} />
</EuiFlexItem>
</EuiFlexGroup>
</MountPointPortal>
{renderSearchBar({ datePickerRef })}
</>
);
}

return (
<>
<MountPointPortal setMountPoint={setMenuMountPoint}>
{renderMenu(menuClassName)}
<EuiFlexGroup alignItems="stretch" gutterSize="none">
<EuiFlexItem grow={false} className="osdTopNavMenuScreenTitle">
<EuiText size="s">{screenTitle}</EuiText>
</EuiFlexItem>
<EuiFlexItem grow={false}>{renderMenu(menuClassName)}</EuiFlexItem>
<EuiFlexItem className="globalDatePicker">
<div ref={datePickerRef} />
</EuiFlexItem>
</EuiFlexGroup>
</MountPointPortal>
{renderSearchBar()}
{renderSearchBar({ datePickerRef })}
</>
);
}
Expand Down

0 comments on commit e5c125d

Please sign in to comment.