MenuBarExtraStyle Window ScrollView issues

I tried to create an menubar application but since it contains multiple View in a Scroll, as you may imagine, i had to use .menuBarExtraStyle(.window).

The point is: the first time I open the menu the height seems to layout properly, but from the second time on, the view resizes to a certain smaller height amount. You may try with this simple snippet:

        MenuBarExtra("", systemImage: "info") {
            ScrollView {
                VStack(alignment: .leading) {
                    ForEach(0..<100) {
                        Text("Row \($0)")
                    }
                }
            }
        }
        .menuBarExtraStyle(.window)

Changing .menuBarExtraStyle(.window) to .menuBarExtraStyle(.menu) fixes the problem but of course you can't build your own layout, functionalities, etc... just display.

Even setting a maximum height - .frame(maxHeight: maxHeight) - for the ScrollView, doesn't seem to affect this behavior.

Did anyone faced this issue? Maybe there's a proper way to proceed and build this kind of layout?

Accepted Reply

This is the expected result (available at first menu app opening)

This is at the second opening

This is with style .menuBarExtraStyle(.menu)

Replies

This is the expected result (available at first menu app opening)

This is at the second opening

This is with style .menuBarExtraStyle(.menu)