Skip to content

Does not work on devices with both mouse and touch screen #228

@kostyantin2216

Description

@kostyantin2216

This library does not support devices with a mouse and a touch screen.

We are using a Windows 8 laptop with a touch screen, what happens is if we select dates or change months with the touch screen everything works fine but if we use the mouse nothing happens.

I looked into the source code and found inside util.js the addEvent function on line 77 has a conditional check which checks if the event type that is being registered is mousedown and if the device is a touch device, if it is then instead of registering mousedown it registers touchstart.

After reading up on touch events and comparing them to click events i saw that both touches and clicks emit one mousedown event, this can be seen here, so my question is if this check is even necessary? I might be missing something but shouldn't this work if we registered mousedown also for touch devices?

Here is the code snippet i am talking about:

if(eventName === 'mousedown' && util.isTouchDevice()) {
	//works on touch devices
	elem.addEventListener('touchstart', listener, false);
} else {
	elem.addEventListener(eventName, listener, false);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions