Show toggle button and divider in Mac Catalyst menu bar (SwiftUI)?

Hi,

When I put Toggle button and divider() in

CommandGroup(replacing: .textFormatting) {
    Toggle("Toggle Toolbar", isOn: $toolbar).keyboardShortcut("T")
    Divider()
}

On macOS 12/13, the Toggle Button is simply display as a button (with no checkbox or other indicators), and Divider is not shown.

Is this a bug or I need to add in some modifiers?

Hi,

I found a partial answer to the issue of Toggle Button not shown properly in menu.

It will works IF there is no keyboard shortcut (a tick will be shown when $toolbar is on). So the solution is not to apply keyboard shortcut.

Show toggle button and divider in Mac Catalyst menu bar (SwiftUI)?
 
 
Q