fermoya / SwiftUIMenu

MIT License
6 stars 3 forks source link

content error when contain tabview #4

Closed huongtran84 closed 4 years ago

huongtran84 commented 4 years ago

When my content contain tabview .i could not click on tabitem

fermoya commented 4 years ago

Hi,

Can you share your code, Xcode version and SwiftUIMenu version, please? It's working for me:

var body: some View {
    TabView {
        menu.tabItem { Text("Tab 1") }
        Text("Another Tab").tabItem { Text("Tab 2") }
    }
}

var menu: some View {
    NavigationView {
        Menu(...)
    }
}

And the result: simulator Have in mind that Menu should be used as a tab, not to wrap TabView.

huongtran84 commented 4 years ago

thanks for your reply.in my case.I want to menu contains 2 tabs.click on tab 2 menubutton still exist to open and close menu.any suggest?

fermoya commented 4 years ago

Hi @huongtran84 ,

I released version 1.1.1. Try this version and call disableContentTap. It should work like that.

simulator

huongtran84 commented 4 years ago

Hi.I face a bug that each close or open menu content view always reload .what is way prevent it?

fermoya commented 4 years ago

Hi @huongtran84 ,

Please, open a new issue for that. Have in mind that in SwiftUI, Views get redrawn when a state variable changes. In this case, Menu has several bindings and states that will trigger an update, that's right.

Let me know if this thread is closed as I'd like to close it.

Thanks