This commit is contained in:
Vanessa 2023-03-08 10:36:33 +08:00
parent 7630cbb291
commit e1569cf1ea
2 changed files with 9 additions and 4 deletions

View file

@ -16,7 +16,7 @@ export class Menu {
const target = event.target as Element;
if (isMobile()) {
const titleElement = hasClosestByClassName(target, "b3-menu__title");
if (titleElement) {
if (titleElement || (typeof event.detail === "string" && event.detail === "back")) {
const lastShowElements = this.element.querySelectorAll(".b3-menu__item--show");
if (lastShowElements.length > 0) {
lastShowElements[lastShowElements.length - 1].classList.remove("b3-menu__item--show");