Clicking time option in dropdown does not populate field if you hold the mouse button down too long #50

Closed
pratie opened this Issue Sep 26, 2014 · 14 comments

Projects

None yet

4 participants

@pratie
pratie commented Sep 26, 2014

Some of our users reported this issue and I found out that they are holding the mouse button down too long after clicking on a time entry. If you hold the mouse button down for about a second or more then the field will not populate. A quick click of the time populates the field.

@wvega
Owner
wvega commented Sep 26, 2014

@pratie thank you for reporting this issue. I'll take a look at it this weekend.

Do you have information about the browsers or OS that are affected?. I haven't tried it out yet, but I ask just in case I have problems reproducing it.

@wvega wvega added the bug label Sep 26, 2014
@wvega wvega self-assigned this Sep 26, 2014
@wvega wvega added this to the 1.3.3 milestone Sep 26, 2014
@pratie
pratie commented Sep 26, 2014

I have seen the issue on Windows using following browsers:
Chrome (version 37.0.2062.124 m)
Firefox (version 32.0.3)
Internet Explorer (version 9.0.8112)

@pratie
pratie commented Oct 3, 2014

To workaround this issue for now I changed the bind event from click to mousedown.
line #389 of current version:
}).bind('click.timepicker', function(event) {

@wvega
Owner
wvega commented Oct 4, 2014

@pratie, thank for all the info. I'll make sure to binding to mousedown s a solution when I start working on this issue.

@michelgallant

I know the library seems to be abandoned, but I love it. In response to the fix by @pratie earlier, the same change needs to be done to line 58.

@KadriV
KadriV commented May 10, 2016

I am also using this library and I am loving this.. But the same problem with this issue :(

@wvega
Owner
wvega commented May 11, 2016

Hi everyone, thanks for you patience and the kind words.

I'm having a hard time trying to reproduce this issue. I tested using Chrome on a Mac and IE 11 on Windows 8.1. I'm going to need help, so I have a couple of questions:

  1. How long is too long? How long do I have to hold down the mouse button in order to reproduce the problem?

  2. Both @pratie and @michelgallant seem to agree that changing the event from click to mousedown fixes the problem. Is that right?

    If that's the case, I may consider using mousedown as solution, even though I can't reproduce the problem, as long as that change doesn't cause other problems.

  3. Maybe I'm not testing with the right settings. @KadriV, can you share here the code you are using to initialise the plugin?

  4. What version of jQuery are you using?

@wvega
Owner
wvega commented May 11, 2016

I just created a modified version of jQuery Timepicker 1.3.2 that uses the mousedown event instead of click.

The minified version can be downloaded from https://gist.github.com/wvega/afe692897338747a8f91df566d50a57a.

@KadriV could you please give that file a try and let me know if that fixes this issue for you?

@KadriV
KadriV commented May 11, 2016

Hello! Thank you so much for answering!

First about the bug.
This is a kind of bug that happens depending on the user who uses the mouse. I actually didn't manage to recreate the problem after I sat down with one person who complained about it.
For example I always manage to populate the input field because I make sharp and short mouse clicks. It doesn't populate if mouse slightly moves a few pixels during the click. So the length of the mouse click is actually not a problem. If the mouse moves in between the mousedown and mouseup - that is the problem.

I found this problem everywhere I tested - Chrome and Firefox in Linux and Windows.
jQuery version is 1.7.2(I know it's old one.. )

I tested this new version and it really does fix the bug, but it also creates a new bug. After selecting a time from drop-down the input stays focused. Before it didn't. If it is focused I cannot reopen the dropdown again until I manually click elsewhere so that the input wouldn't be focused.

Thanks again! I hope this helps :)

@wvega
Owner
wvega commented May 13, 2016 edited

@KadriV thank you for all that information. It is very helpful.

I think I saw the problem with moving the cursor between the mousedown and mouseup events as well, so that's something I can reproduce and work with.

I tried clicking links in this page, for example, and if you move the cursor enough to be out of the original clicking area, the click doesn't seem to register. I guess that's what is happening with the time picker. Using mousedown instead of click seems to be the way to go then.

I'll look into the focus problem you mentioned and once that's fixed too, I'll push a new version.

Thank you for your help :)

@wvega wvega added a commit that referenced this issue May 21, 2016
@wvega Add tests for issue #50.
The problem was fixed as part of the solution for issue #56.
e93bfbd
@wvega
Owner
wvega commented May 21, 2016

The modifications to fix this problem are now part of jQuery Timepicker 1.3.3.

Thank you @KadriV, @pratie and @michelgallant for your help debugging and testing the solution for this issue.

@wvega wvega closed this May 21, 2016
@KadriV
KadriV commented May 23, 2016

@wvega Thank you!

@KadriV
KadriV commented May 23, 2016

@wvega Can you please also update the npm-package to the latest release? :)

@wvega
Owner
wvega commented May 23, 2016

@KadriV just did it. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment