googlearchive / paper-tabs

A tabs à la Material Design
22 stars 21 forks source link

Selection bar does not appear by default in closed core-collapse #50

Open tiesselune opened 9 years ago

tiesselune commented 9 years ago

If a paper-tabs element is the child of a core-collapse element that is initially closed, the selection bar is invisible until selection changes.

<core-collapse opened="false">
    <paper-tabs selected="0">
        <paper-tab>One</paper-tab>
        <paper-tab>Two</paper-tab>
        <paper-tab>Three</paper-tab>
    </paper-tabs>
    <!-- some markup -->
</core-collapse>

Manually calling resizeHandler() as soon as the core-collapse begins to open solves the problem, but it is not meant to be public, so either a fix or a cleaner solution (if fixing is impossible by design) would be a good idea.

aktasmehmet commented 8 years ago

+1 on this. I am facing with a similar problem. The problem is in _tabChanged method of paper-tabs.html. It calculates the width and the position of selection bar and executes:

this._positionBar(this._pos.width, this._pos.left);

But if the page or parent element of paper-tabs is not rendered yet, "this._pos.width" and "this._pos.left" returns null. This causes selection bar not to appear. You can manually handle this problem by changing paper-tabs.html but it looks like this is a bug and have to be fixed.