PolymerElements/paper-tabs

Right Scrollbutton does not work correctly when using Zoom

felvhage opened this issue · 4 comments

Description

The 'paper-tabs' element with attribute 'scrollable' uses Scrollbuttons left and right to allow scrolling through the contained tabs. When it is not possible to scroll further to left or right, the respective scrollbutton gets faded out. However, when using Browser-Zoom, the right scrollbutton does not get faded out.

This problem occurs because the arithmetics in the method '_affectScroll' does not take (zoom induced) rounding errors into account.

current impl:
this._rightHidden = scrollLeft === this._tabContainerScrollSize;

better impl:
this._rightHidden = Math.ceil(scrollLeft) >= this._tabContainerScrollSize;

Expected outcome

Right scrollbutton should get faded out.

Actual outcome

Right scrollbutton stays visible.

Live Demo

https://jsbin.com/zofuwuj/edit?html,output

Steps to reproduce

Browsers Affected

  • Chrome
  • Firefox
  • Safari 9
  • Safari 8
  • Safari 7
  • Edge
  • IE 11
  • IE 10

Made the pull-request twice. Its the same fix. I'm new to this. It has no test because i unsure how to simulate Browser-Zoom.

Found out how to simulate "zoom" in Chrome. Tests added. This should be it.

Well, not just yet. Shadow-Dom-Tests failing.

Tests fixed.

Stuck on a build-error concerning Firefox:
The command "xvfb-run wct -l firefox" exited with 1.

Tests work fine in Firefox locally. Clue anyone?