Skip to content
This repository has been archived by the owner on Dec 19, 2024. It is now read-only.

Right Scrollbutton does not work correctly when using Zoom #168

Open
1 of 8 tasks
felvhage opened this issue Jun 1, 2016 · 4 comments · May be fixed by #169
Open
1 of 8 tasks

Right Scrollbutton does not work correctly when using Zoom #168

felvhage opened this issue Jun 1, 2016 · 4 comments · May be fixed by #169

Comments

@felvhage
Copy link

felvhage commented Jun 1, 2016

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
felvhage added a commit to felvhage/paper-tabs that referenced this issue Jun 1, 2016
This fixes PolymerElements#168. When using Browser-Zoom scrollLeft can be a decimal number. Using Math.ceil on scrollLeft will ensure that the condition will be met in this case and the rightHidden will be set properly.
felvhage added a commit to felvhage/paper-tabs that referenced this issue Jun 1, 2016
This fixes PolymerElements#168. When using Browser-Zoom scrollLeft can be a decimal number. Using Math.ceil on scrollLeft will ensure that the condition will be met in this case and the rightHidden will be set properly.
@felvhage
Copy link
Author

felvhage commented Jun 1, 2016

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.

@felvhage felvhage linked a pull request Jun 2, 2016 that will close this issue
@felvhage
Copy link
Author

felvhage commented Jun 2, 2016

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

@felvhage
Copy link
Author

felvhage commented Jun 2, 2016

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

@felvhage
Copy link
Author

felvhage commented Jun 3, 2016

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?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants