From 59401536c4f8989416b66e1e9947da0bf617909b Mon Sep 17 00:00:00 2001 From: hinzzx Date: Thu, 29 Jun 2023 10:30:55 +0300 Subject: [PATCH] feat(ui5-menu): code review changes --- packages/main/src/Menu.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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) {