[GH-ISSUE #157] How are submenus supposed to work? #97

Closed
opened 2026-05-05 11:41:42 -06:00 by gitea-mirror · 5 comments
Owner

Originally created by @jesobreira on GitHub (Jun 14, 2018).
Original GitHub issue: https://github.com/kusti8/proton-native/issues/157

The docs are clear:

The menu must come outside and before the Window for it to take effect. It is made up of Menu.Items. Menus can be embedded inside eachother to make sub-menus.

However, this:

<Menu label="Tools">
            <Menu.Item type="Preferences" />
            <Menu.Item>Network</Menu.Item>
            <Menu.Item type="Separator" />
            <Menu.Item>Sign Message</Menu.Item>
            <Menu label="Load Transaction">
                      <Menu.Item>From file</Menu.Item>
                      <Menu.Item>From text</Menu.Item>
            </Menu>
</Menu>

Causes this:

captura de tela 2018-06-14 as 00 05 06

At least on Mac OS X 10.13.2, the "Load Transaction" item is rather created as a main menu, and not as submenu, despite it being inside a <Menu> item.

How was this supposed to be done? Perhaps an example on it could be added to the docs.

Note: I only tested it on OS X.

Originally created by @jesobreira on GitHub (Jun 14, 2018). Original GitHub issue: https://github.com/kusti8/proton-native/issues/157 The [docs](https://proton-native.js.org/#/component_APIs/menu) are clear: > The menu must come outside and before the Window for it to take effect. It is made up of Menu.Items. **Menus can be embedded inside eachother to make sub-menus.** However, this: ``` <Menu label="Tools"> <Menu.Item type="Preferences" /> <Menu.Item>Network</Menu.Item> <Menu.Item type="Separator" /> <Menu.Item>Sign Message</Menu.Item> <Menu label="Load Transaction"> <Menu.Item>From file</Menu.Item> <Menu.Item>From text</Menu.Item> </Menu> </Menu> ``` Causes this: <img width="180" alt="captura de tela 2018-06-14 as 00 05 06" src="https://user-images.githubusercontent.com/3002249/41389341-a043de14-6f66-11e8-972b-ec2f0747083b.png"> At least on Mac OS X 10.13.2, the "Load Transaction" item is rather created as a main menu, and not as submenu, despite it being inside a `<Menu>` item. How was this supposed to be done? Perhaps an example on it could be added to the docs. Note: I only tested it on OS X.
Author
Owner

@mischnic commented on GitHub (Jun 14, 2018):

Submenues aren't supported. The docs are wrong.

<!-- gh-comment-id:397198603 --> @mischnic commented on GitHub (Jun 14, 2018): Submenues aren't supported. The docs are wrong.
Author
Owner

@jesobreira commented on GitHub (Jun 14, 2018):

I see. Is this a libui limitation? Or it's something I can help with, on proton-native sphere?

<!-- gh-comment-id:397323517 --> @jesobreira commented on GitHub (Jun 14, 2018): I see. Is this a libui limitation? Or it's something I can help with, on proton-native sphere?
Author
Owner

@parro-it commented on GitHub (Jun 14, 2018):

Is this a libui limitation?

Yes, ATM. See also andlabs/libui#321 and parro-it/libui-node#110

<!-- gh-comment-id:397325495 --> @parro-it commented on GitHub (Jun 14, 2018): > Is this a libui limitation? Yes, ATM. See also andlabs/libui#321 and parro-it/libui-node#110
Author
Owner

@jesobreira commented on GitHub (Jun 14, 2018):

Got it. May I create a PR that fixes the docs about it?

I also find it interesting to note that menus can be created inside <React.Fragment> tags, so that users are able to import menus from external files.

<!-- gh-comment-id:397329789 --> @jesobreira commented on GitHub (Jun 14, 2018): Got it. May I create a PR that fixes the docs about it? I also find it interesting to note that menus can be created inside `<React.Fragment>` tags, so that users are able to import menus from external files.
Author
Owner

@mischnic commented on GitHub (Jun 17, 2018):

Got it. May I create a PR that fixes the docs about it?

Sure.

<!-- gh-comment-id:397863992 --> @mischnic commented on GitHub (Jun 17, 2018): > Got it. May I create a PR that fixes the docs about it? Sure.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/proton-native#97
No description provided.