Skip to content
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

unresponsive click events on touchscreen desktops and smartboards #34

Closed
MuellerMatthew opened this issue Jul 29, 2015 · 0 comments
Closed

Comments

@MuellerMatthew
Copy link
Contributor

While working with the leaflet sidebar-v2 on a smartboard, I noticed that the mouse click events on the sidebar tabs were not being captured, and that only touch events were being captured.
This issue stems from several lines of code in the sidebar plugin which don't add a click event listener if the device has touchscreen capabilities, so for device which has both a touch screen and a mouse, the sidebar wont work when using the mouse.
var e = this._hasTouchStart ? 'touchstart' : 'click';
After doing some testing with IE, Chrome, and Firefox on a standard windows desktop, a mac desktop, a nexus tablet, and a smartboard, it appears that having the touchstart event capture is redundant since the default click event in leaflet is already capturing both touch and click events.

I will shortly be submitting a pull request to address this issue, by removing
this._hasTouchStart = L.Browser.touch && ('ontouchstart' in document.documentElement);
and changing
var e = this._hasTouchStart ? 'touchstart' : 'click';
to
var e = 'click';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant