This commit is contained in:
Vanessa 2022-07-27 07:20:27 +08:00
parent 13ba672d1b
commit 2d348be542
7 changed files with 14 additions and 16 deletions

View file

@ -33,7 +33,7 @@ export class Menu {
itemElement.classList.add("b3-menu__item--show");
const rect = subMenuElement.getBoundingClientRect();
let style = "";
const leftPosition = rect.left - this.element.clientWidth - rect.width
const leftPosition = rect.left - this.element.clientWidth - rect.width;
if (rect.right > window.innerWidth && (
leftPosition > 0 || Math.abs(leftPosition) < (rect.right - window.innerWidth))) {
if (leftPosition >= 0) {