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

mousedown bug fixed(chrome) #159

Open
sagestudios opened this issue Oct 5, 2016 · 0 comments
Open

mousedown bug fixed(chrome) #159

sagestudios opened this issue Oct 5, 2016 · 0 comments

Comments

@sagestudios
Copy link

We are working on 2 major projects using limejs and strange bug is that many times project stops taking mouse events inside chrome browser. After checking code of limejs we found the bug inside class Node(node.js) , function "lime.Node.prototype.listen"

Inside this function there is a check for touch devices and bypassing mouse events and here chrome returning wrong value, its returning true for non-touch devices as well(laptops)

// Bypass all mouse events on touchscreen devices
    if (lime.userAgent.SUPPORTS_TOUCH &&
        type.substring(0, 5) == 'mouse') return null;

lime.userAgent.SUPPORTS_TOUCH is defined in useragent.js. So we replaced this check and added manual checking for ios and android device.

// Bypass all mouse events on touchscreen devices
    if ((lime.userAgent.IOS || lime.userAgent.ANDROID) &&
        type.substring(0, 5) == 'mouse') return null;

You can add other device checks if you want. Finally all mouse events working inside chrome :)

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