Skip to content

Support menuDidClose/menuWillOpen #8999

Closed

Description

@smith-kyle
  • Electron version: 1.6.2
  • Operating system: macOS

Expected behavior

Allow users to register a callback for menu open and close events.

const menu = new Menu()

menu.onOpen(() => { /* Do something when the menu opens */ })
menu.onClose(() => { /* Do something when the menu closes */ })

Actual behavior

Not supported

NSMenuDelegate exposes these events: https://developer.apple.com/reference/appkit/nsmenudelegate

Not sure about Windows or Linux

Activity

  1. shubham2892 commented on Jun 20, 2017

    @shubham2892
    Contributor

    MenuWillOpen and MenuDidClose events are already implemented here, I wonder why they are not documented. 🤔

  2. self-assigned this
    on Sep 27, 2017
  3. codebytere commented on Jan 23, 2018

    @codebytere
    Member

    i'll try to get to this this week

  4. codebytere commented on Jan 27, 2018

    @codebytere
    Member

    @shubham2892 @smith-kyle PR is in flight at #11754, will be merged pending review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions