PolymerElements / paper-tabs

Material Design tabs
https://www.webcomponents.org/element/PolymerElements/paper-tabs
65 stars 52 forks source link

`disableDrag` property not used #232

Open jarrodek opened 6 years ago

jarrodek commented 6 years ago

Description

The disableDrag property is not used anywhere in the code and therefore it is not working as intended. I believe that _scroll() function supposed to have the following condition but it is missing.

_scroll: function(e, detail) {
  if (!this.scrollable || this.disableDrag) {
    return;
  }
  ...
},

Expected outcome

Tabs are not scrolling when used in the following way:

<paper-tabs scrollable disable-drag>
   ...
</paper-tabs>

Actual outcome

You can still drag the tabs. It is a problem when you implement your own draggable tabs so you can rearrange pages.

Steps to reproduce

  1. Create enough tabs so they won't fit into the available area.
  2. Set both scrollable and disable-drag attributes or corresponding properties.
  3. Drag the list of tabs

Browsers Affected

It's not dependent on browser.

jarrodek commented 6 years ago

Just as a workaround:

<paper-tabs scrollable disable-drag id="tabs">
   ...
</paper-tabs>
connectedCallback() {
  super.connectedCallback();
  this.$.tabs._scroll = function() {};
}