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

Tab bar right arrow #312

Open
geertolaerts opened this issue May 12, 2017 · 2 comments
Open

Tab bar right arrow #312

geertolaerts opened this issue May 12, 2017 · 2 comments

Comments

@geertolaerts
Copy link

I am just getting started with elm and elm-mdl and so far love it. I however have an annoying bug/problem when using the tab bar.
My main view looks quite simple:

view : Model -> Html Msg
view model =
    Layout.render Msgs.Mdl
        model.mdl
        [ Layout.fixedHeader
        , Layout.selectedTab model.selectedTab
        , Layout.onSelectTab Msgs.SelectTab
        ]
        { header = [ h1 [ style [ ( "padding", "2rem" ) ] ] [ text "Carma Mock" ] ]
        , drawer = []
        , tabs = ( [ text "Current Offers", text "Paid Offers", text "Settings" ], [ Color.background (Color.color Color.Teal Color.S400) ] )
        , main = [ div [] [ page model ] ]
        }
        |> Material.Scheme.topWithScheme Color.Teal Color.LightGreen

There are two things wrong see picture:
screen shot 2017-05-12 at 13 34 25

One is that the right arrow is displayed, even though i only have 3 tabs. The other is the gap between my tabs and the arrow.
Is this a bug or did i do something wrong?

@aforemny aforemny modified the milestone: v8 Jun 26, 2017
@aforemny aforemny self-assigned this Jun 30, 2017
@aforemny
Copy link
Collaborator

aforemny commented Jun 30, 2017

Hi! Do you have subscriptions set up? Could you post an example index.html + Main.elm somewhere that I can try?

@aforemny aforemny removed this from the v8 milestone Jun 30, 2017
@rupertlssmith
Copy link

I have the same issues.

I think it happens because you set the CSS 'box-sizing: border-box;' on the element. This would cause the padding for the space where the left chevron goes to be included in the width calculation for the whole tab bar, meaning it ends up that amount shorter than it should be. 'box-sizing: border-box' is quite a common thing to set in a CSS reset, so check all CSS that you are including.

elm-mdl does not know how wide your tabs are. Set up a suitable width using Material.Layout.setTabsWidth, to avoid the scroll chevrons being shown when they don't need to be.

@aforemny aforemny removed their assignment Jan 19, 2022
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

3 participants