googlearchive / paper-tabs

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

[1.0.2] issues w/ #selectionBar #68

Closed robrez closed 9 years ago

robrez commented 9 years ago

I'm migrating some code from 0.5.2 to 1.0.2 and am seeing some inconsistent behavior out of my paper-tabs. #selectionBar can go missing and the trouble seems to relate to the fact that I'm hiding the paper-tabs in certain situations.

My original code used a conditional template to swap out toolbars (one of which contains the tabs) whenever certain pages are selected. I tried to work-around the problems by using a conditional hidden$ attribute instead of a dom-if.

My general setup is that I've bound a set of paper-tabs and neon-animated-pages to a selected property:

    properties: {
      selected: {
        type: Number,
        value: 0,
        notify: true
      }
    }
<paper-tabs id="tabs" selected="{{selected}}">
...
<neon-animated-pages selected="{{selected}}">
  <blah-inbox/>
  <blah-outbox/>
  <blah-compose/>
</neon-animated-pages>

When pages 1 or 2 (inbox, outbox) are selected, the toolbar containing the tabs is visible. When page 3 (compose) is selected (by clicking the create icon), I replace the toolbar w/ one that is context-appropriate for that page's function. The 3rd pages toolbar has a declarative on-tap event that changes selected back to one of the other pages...

    showPreviousPage: function() {
      this.set('selected', 0);   //previously tried `this.selected = 0;`
    },

Note: The correct page is always being displayed. These numbered items correspond to the image below:

  1. initial state: selected = 0, tab displays correctly
  2. this is how things look after showPreviousPage sets selected back to 0.
  3. clicking "Sent" (selected = 1), #selectionBar is still missing

tabs

Clicking back on "Inbox" (selected = 0) does get everything back to a correct looing state (like figure 1).

notwaldorf commented 9 years ago

I thiiiiiiink @cdata just fixed this for 1.0 with https://github.com/PolymerElements/paper-tabs/pull/33. Would you mind checking if that fix works for you? Thanks!

robrez commented 9 years ago

:( No dice for me. I'll see if I can puzzle out any more details.

(Just realized I posted this in Polymer/paper-tabs instead of PolymerElements/paper-tabs... Oops!).

robrez commented 9 years ago

Closing. Moved the issue to PolymerElements/paper-tabs where I've provided a simpler duplication path and some additional findings.