Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tabs Overcomplexity #363

Open
hickscorp opened this issue Dec 29, 2017 · 0 comments
Open

Tabs Overcomplexity #363

hickscorp opened this issue Dec 29, 2017 · 0 comments

Comments

@hickscorp
Copy link

hickscorp commented Dec 29, 2017

I'm rather new to the whole Elm thing, so please bare with me.

The fact that the tabs trigger a selected index message is IMO a source of over-complexifying most of the MDL layouts. If you have only one tab bar, it's easy and fun. But if you have as many tab bars as you have contexts (Eg General Page has 3 tabs Home, Contact, About. Dashboard Page has tabs Profile and Friends, etc).

A very good addition to elm-mdl would probably be a way to have a onSelect action assigned to each tab, to remove the need of mapping from / to Int indices eg:

view model =
    Layout.render Mat
        model.mdl
        [ ... ]
        { header = ...
        , drawer = ...
        , tabs = ( [ Tab.item [onClick (NavMsg (GeneralPage Home))] [ text "Home" ] ], [] )
        , main = ...
        }

Again, I'm pretty new to this, so if I missed something feel free to close this enhancement request issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant