Skip to content

mousedown bug fixed(chrome) #159

@sagestudios

Description

@sagestudios

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 :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions