Commit 5ae32778 authored by Olena Horal-Koretska's avatar Olena Horal-Koretska

Merge branch '335498-fix-fly-out-menu' into 'master'

Correctly positioned the is-above flyouts

See merge request gitlab-org/gitlab!65735
parents 284dc8d2 8d114964
......@@ -88,12 +88,12 @@ export const moveSubItemsToPosition = (el, subItems) => {
const boundingRect = el.getBoundingClientRect();
const left = sidebar ? sidebar.offsetWidth : COLLAPSED_PANEL_WIDTH;
let top = calculateTop(boundingRect, subItems.offsetHeight);
const isAbove = top < boundingRect.top;
if (hasSubItems) {
top -= header.offsetHeight;
top = isAbove ? top : top - header.offsetHeight;
} else {
top = boundingRect.top;
}
const isAbove = top <= boundingRect.top;
subItems.classList.add('fly-out-list');
subItems.style.transform = `translate3d(${left}px, ${Math.floor(top) - getHeaderHeight()}px, 0)`; // eslint-disable-line no-param-reassign
......
......@@ -316,6 +316,10 @@
a.has-sub-items + .sidebar-sub-level-items.fly-out-list {
@include gl-mt-n2;
&.is-above {
@include gl-mt-2;
}
}
@media (min-width: map-get($grid-breakpoints, md)) and (max-width: map-get($grid-breakpoints, xl) - 1px) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment