diff --git a/packages/main/src/Menu.ts b/packages/main/src/Menu.ts index 81148b10ad46..636731a6f6e2 100644 --- a/packages/main/src/Menu.ts +++ b/packages/main/src/Menu.ts @@ -43,6 +43,9 @@ type CurrentItem = { ariaHasPopup: string | undefined, } +const MENU_OPEN_DELAY = 300; +const MENU_CLOSE_DELAY = 400; + type TimeoutIDMap = Record; type MenuItemClickEventDetail = { @@ -546,7 +549,7 @@ class Menu extends UI5Element { // Sets the new timeout this.hoverTimeouts[item.id] = window.setTimeout(() => { this._prepareSubMenuDesktopTablet(item, opener, hoverId); - }, 300); + }, MENU_OPEN_DELAY); } startCloseTimeout(item: MenuItem) { @@ -556,7 +559,7 @@ class Menu extends UI5Element { // Sets the new timeout this.unhoverTimeouts[item.id] = window.setTimeout(() => { this._closeItemSubMenu(item); - }, 400); + }, MENU_CLOSE_DELAY); } clearOpenTimeout(item: MenuItem) {