bendavis78 / paper-time-picker

Material design time picker component for polymer
http://bendavis78.github.io/paper-time-picker/
MIT License
89 stars 63 forks source link

Scrolling or zooming in/out prevents time selection #46

Closed buitcj closed 7 years ago

buitcj commented 7 years ago

Repro 1: load paper-time-picker/demo/index.html, choose an hour to note that it works, zoom in or out, now try to choose a minute and notice that it cannot be selected (nor does any animation or change in display occur). Note that you can click on certain points on the clock and the time will be selected, but it wont be what is expected.

Repro 2: create a polymer component with paper-time-picker and enough elements on the page that you can scroll. Load the page, click on an hour to note that it works, then scroll down one mousewheel click, now try to choose a minute and notice that it cannot be selected (nor does any animation or change in display occur). Note that you can click on certain points on the clock and the time will be selected, but it wont be what is expected.

Here is my repro 1 code: http://pastebin.com/Cp8De1A9

binaryblake commented 7 years ago

I am seeing this as well. Just submitted #49 which includes a fix.

hadams95 commented 7 years ago

The culprit would be in paper-clock-selector if I am not mistaken. Look for the function "_updateSize" and you will find this conditional return statement:

if (!radius || this._resizedCache === radius) {
     return;
}

The company I work for has a forked repo where I changed to just check falsiness

if (!radius) {
     return;
}

We use it in a draggable, resizable window so the radius remaining unchanged shouldn't determine whether or not we want to perform the calculations. Before this fix, if we dragged our resizable window to any different position, the offsets would remain in the same position as before and time selection would be virtually impossible for a user.

Although it looks like binaryblake's pull request addresses this exact problem.

admwx7 commented 7 years ago

Looks like a fix is in, someone can create a new issue if this is still a problem for them.