mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
feat: add support for keyboard initialized menu popup (#38954)
* feat: add support for keyboard initialized menu popup Co-authored-by: Samuel Attard <marshallofsound@electronjs.org> * Update docs/api/menu.md Co-authored-by: Erick Zhao <erick@hotmail.ca> Co-authored-by: Samuel Attard <sam@electronjs.org> * fix: add patch to chromium for keyboard accessibility menu behavior Co-authored-by: Samuel Attard <marshallofsound@electronjs.org> * refactor: s/initiatedByKeyboard/sourceType Co-authored-by: Samuel Attard <marshallofsound@electronjs.org> * fix: ignore initial mouse event to retain keyboard initiated focus Co-authored-by: Samuel Attard <marshallofsound@electronjs.org> * Update docs/api/menu.md Co-authored-by: Samuel Maddock <samuel.maddock@gmail.com> Co-authored-by: Samuel Attard <sam@electronjs.org> --------- Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Samuel Attard <marshallofsound@electronjs.org> Co-authored-by: Samuel Attard <sam@electronjs.org>
This commit is contained in:
@@ -80,6 +80,10 @@ The `menu` object has the following instance methods:
|
||||
* `positioningItem` number (optional) _macOS_ - The index of the menu item to
|
||||
be positioned under the mouse cursor at the specified coordinates. Default
|
||||
is -1.
|
||||
* `sourceType` string (optional) _Windows_ _Linux_ - This should map to the `menuSourceType`
|
||||
provided by the `context-menu` event. It is not recommended to set this value manually,
|
||||
only provide values you receive from other APIs or leave it `undefined`.
|
||||
Can be `none`, `mouse`, `keyboard`, `touch`, `touchMenu`, `longPress`, `longTap`, `touchHandle`, `stylus`, `adjustSelection`, or `adjustSelectionReset`.
|
||||
* `callback` Function (optional) - Called when menu is closed.
|
||||
|
||||
Pops up this menu as a context menu in the [`BrowserWindow`](browser-window.md).
|
||||
|
||||
Reference in New Issue
Block a user