fix: menu should allow focused BaseWindow
where possible (#43439)
fix: menu should allow focused BaseWindow Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
parent
557d5c901a
commit
a373ab027b
5 changed files with 25 additions and 19 deletions
|
@ -1,5 +1,5 @@
|
|||
import * as roles from '@electron/internal/browser/api/menu-item-roles';
|
||||
import { Menu, BrowserWindow, WebContents, KeyboardEvent } from 'electron/main';
|
||||
import { Menu, BaseWindow, WebContents, KeyboardEvent } from 'electron/main';
|
||||
|
||||
let nextCommandId = 0;
|
||||
|
||||
|
@ -53,7 +53,7 @@ const MenuItem = function (this: any, options: any) {
|
|||
});
|
||||
|
||||
const click = options.click;
|
||||
this.click = (event: KeyboardEvent, focusedWindow: BrowserWindow, focusedWebContents: WebContents) => {
|
||||
this.click = (event: KeyboardEvent, focusedWindow: BaseWindow, focusedWebContents: WebContents) => {
|
||||
// Manually flip the checked flags when clicked.
|
||||
if (!roles.shouldOverrideCheckStatus(this.role) &&
|
||||
(this.type === 'checkbox' || this.type === 'radio')) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue