Skip to content

Commit b54d075

Browse files
authored
refactor: remove obsolete overlay positioning logic for menu bar (#4637)
1 parent ae61027 commit b54d075

1 file changed

Lines changed: 0 additions & 25 deletions

File tree

‎packages/menu-bar/src/vaadin-menu-bar-interactions-mixin.js‎

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ export const InteractionsMixin = (superClass) =>
4747

4848
const overlay = this._subMenu.$.overlay;
4949
overlay.addEventListener('keydown', this.__boundOnContextMenuKeydown);
50-
overlay.addEventListener('vaadin-overlay-open', this.__alignOverlayPosition.bind(this));
5150

5251
const container = this._container;
5352
container.addEventListener('click', this.__onButtonClick.bind(this));
@@ -276,30 +275,6 @@ export const InteractionsMixin = (superClass) =>
276275
return this.shadowRoot.querySelector('vaadin-menu-bar-submenu');
277276
}
278277

279-
/** @private */
280-
__alignOverlayPosition(e) {
281-
/* c8 ignore next */
282-
if (!this._expandedButton) {
283-
// When `openOnHover` is true, quickly moving cursor can close submenu,
284-
// so by the time when event listener gets executed button is null.
285-
// See https://github.com/vaadin/vaadin-menu-bar/issues/85
286-
return;
287-
}
288-
const overlay = e.target;
289-
const { width, height, left } = this._expandedButton.getBoundingClientRect();
290-
if (overlay.hasAttribute('bottom-aligned')) {
291-
overlay.style.bottom = `${parseInt(getComputedStyle(overlay).bottom) + height}px`;
292-
}
293-
const endAligned = overlay.hasAttribute('end-aligned');
294-
if (endAligned) {
295-
if (this.__isRTL) {
296-
overlay.style.left = `${left}px`;
297-
} else {
298-
overlay.style.right = `${parseInt(getComputedStyle(overlay).right) - width}px`;
299-
}
300-
}
301-
}
302-
303278
/** @private */
304279
_itemsChanged() {
305280
const subMenu = this._subMenu;

0 commit comments

Comments
 (0)