Skip to content

Commit

Permalink
feat(ui5-menu): code review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
hinzzx committed Jun 29, 2023
1 parent 9411ac6 commit 5940153
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/main/src/Menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ type CurrentItem = {
ariaHasPopup: string | undefined,
}

const MENU_OPEN_DELAY = 300;
const MENU_CLOSE_DELAY = 400;

type TimeoutIDMap = Record<string, number>;

type MenuItemClickEventDetail = {
Expand Down Expand Up @@ -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) {
Expand All @@ -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) {
Expand Down

0 comments on commit 5940153

Please sign in to comment.