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

CollapseAt doesn't collapse the nav at the expected spot. #64

Closed
ppeyro opened this issue Jul 20, 2017 · 1 comment
Closed

CollapseAt doesn't collapse the nav at the expected spot. #64

ppeyro opened this issue Jul 20, 2017 · 1 comment

Comments

@ppeyro
Copy link

ppeyro commented Jul 20, 2017

Expected behavior and actual behavior:

Used collapseAt to set a breaking point where the horizontal nav would collapse into the menu nav. The collapse happens +95 pixels from the expected spot.

Environment:

App-Nav: Master-7/18 evening Pull
Browsers: Chrome

Screenshot:

Collapse at set to 950, but happens at 1045px:

screen shot 2017-07-20 at 11 45 35 am

Code example:

<px-app-nav
        items='[
          { "label" : "Home", "id" : "home", "icon" : "px-fea:attribute" },
          { "label" : "Alerts", "id" : "alerts", "icon" : "px-fea:alerts" },
          { "label" : "Dashboards", "id" : "dashboards", "icon" : "px-fea:dashboard", "children": [
            { "label" : "See Live Truck View", "id" : "trucks" },
            { "label" : "Track Orders", "id" : "orders" },
            { "label" : "Analyze Invoices", "id" : "invoices" }
          ]},
          { "label" : "Assets", "id" : "assets", "icon" : "px-fea:asset" },
          { "label" : "Analytics", "id" : "analytics", "icon" : "px-fea:analytics" },
          { "label" : "Alarms", "id" : "alarms", "icon" : "px-obj:line-og" }
        ]'

        collapse-at="950"
...

/cc @davidrleonard
@davidrleonard
Copy link
Collaborator

We found the issue: The collapse-at value is measuring the size of the container available to the px-app-nav element, not the window size. Therefore, if there is a scroll bar (or anything else that shrinks the available width of the px-app-nav el below the viewport width), the element may collapse before the window hits the collapse-at value. This should be documented.

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

No branches or pull requests

2 participants