diff --git a/app/javascript/controllers/menu_button_controller.ts b/app/javascript/controllers/menu_button_controller.ts index 208252260..c0b407242 100644 --- a/app/javascript/controllers/menu_button_controller.ts +++ b/app/javascript/controllers/menu_button_controller.ts @@ -154,6 +154,13 @@ export class MenuButtonController extends ApplicationController { switch (event.key) { case ' ': case 'Enter': + if (this.isOpen) { + this.close(); + } else { + this.open(); + } + stopPropagation = true; + break; case 'ArrowDown': case 'Down': this.open();