Skip to content

Main app menu is buggy on macOS if user interacts with it while it's being updated #12636

Closed

Description

@sindresorhus
  • Electron version: 2.0.0-beta.7
  • Operating system: macOS 10.13.4

Expected behavior

I expected Electron to not update the menu while it's being interacted with.

It should behave like native and not update when open.

Actual behavior

electron-menu

How to reproduce

Run this and try to click the Electron menu and hover Bar menu item multiple times.

const electron = require('electron');

const buildMenu = () => {
	electron.Menu.setApplicationMenu(electron.Menu.buildFromTemplate([{
		label: 'Foo',
		submenu: [
			{
				label: 'Bar'
			}
		]
	}]));
};

electron.app.on('ready', () => {
	setInterval(buildMenu, 1000);
});

Since Electron has no good way to make dynamic menus, rebuilding it based on events in the renderer process is the only way to keep the menu in sync with the content in the renderer.

Activity

  1. petrbrzek commented on Apr 19, 2018

    @petrbrzek

    @sindresorhus Is it specific to version 2.0? I think the same thing happens in 1.x as well.

  2. self-assigned this
    on May 3, 2018
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