New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
replace onmousedown with onmouseup #249
Comments
suggestion: e.g. the datepickers of the bigger booking portals like expedia.com and booking.com have similar behaviour |
As soon as I click the whole popup is gone I can't drag and select anything. |
@rikkert I faced the problems just on Chrome (Windows), the problem does not appear on Firefox or Internet Explorer. Furthermore, the problem occurs when using a div (with the trigger option), not when using an input field. |
screenshot it seems that the problem occurs when you click on a date (mousedown -> the datepicker disappears) and then you release the mouse button (mouseup), while the position of the mouse button has changed slightly I have created a very simple example (screenshot), on more complex pages in production, the whole page gets highlighted with blue color |
|
another screenshot with code (datepicker in larger div)
|
I also found this to be an issue, but as a dirty fix (workaround) i just increased the time on line 490 (https://github.com/dbushell/Pikaday/blob/master/pikaday.js#L490) from 50 to 100. This adds a slight delay between the events and seems to keep chrome happy. |
To me this seems default browser behavior. |
@rikkert it is an annoying user experience, as selecting text is NOT intended, but happens nonetheless "start dragging, the picker closes and then I start selecting text" in this case seems to be a question of milliseconds not sure why nobody has complained so far, seems like the issue is limited to chrome on windows, which in my case are 20% of users or is it just a broken mouse playing tricks on me? |
I can confirm the same behaviour on Chrome 40 (latest stable) and Safari 8.0.3 (latest stable) on OS X. It's very annoying and it's actually a poor user experience, and should be prevented at any point. Pikaday is a 'user-interface object', not 'content' that should be selectable. Here's a screenshot when selecting a date from Pikaday (PIkaday is closed after selecting a date, but all other surrounding object get select): Of course there's custom styling and functions, but still selecting a date should prevent any other event from firing. Using |
Does it work? :) |
Had to remove the preventDefault because it breaks the month and year dropdown. |
is there a chance to replace onmousedown with onmouseup events?
problem: when clicking on a day in chrome browser, and holding the mouse button a bit longer than normal, while moving the mouse only slightly, the whole page gets "selected" (that means highlighted, starting from the position of the datepicker to the end of page)
also, the event should not fire when draggin the mouse outside the target's region (the day selected on mousedown)
The text was updated successfully, but these errors were encountered: