Skip to content

Commit

Permalink
feat(menu-flyout): close menu with click on trigger (#1126)
Browse files Browse the repository at this point in the history
  • Loading branch information
Arturo Castillo Delgado authored Jul 8, 2022
1 parent bb48463 commit 2372c43
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,10 @@ export class MenuFlyout {

toggle = () => {
const list = this.getListElement();
// We could check for `list.opened === true` to do `closeAll`
// but list close themselves with outside clicks, so `list.opened`
// will always be `false` here…
if (list.opened) {
this.closeAll();
return;
}
if (this.direction != null) {
// Overwrite `direction` in list
list.direction = this.direction;
Expand Down

0 comments on commit 2372c43

Please sign in to comment.