Search code examples
sproutcore

Mouse clicks don't work on official SproutCore Demo sites on certain Windows 7 computers


I have an application built with SproutCore, and recently several Windows 7 users have reported that mouseclicks (buttons, radio buttons, etc.) don't work at all, on either the latest Chrome or Firefox browsers.

After trying several Windows 7 computers, I finally found one that replicates the problem. Not only that, I found that the problem is visible on the official SproutCore demo sites, http://showcase.sproutcore.com and http://demo.sproutcore.com. While the latter is running an old version of SC, the former is running SproutCore 1.10.0.

On the demo site, none of the controls that require a mouseclick work. The main demo selector scrolls with the scroll wheel, but nothing can be selected. At http://demo.sproutcore.com/sample_controls/ the tabs can't be clicked. At http://showcase.sproutcore.com/#ui/SC.ButtonView the buttons don't respond, etc, etc.

This is replicatable on my computer and the computers of two of my users, using both Chrome and Firefox, but IE 10 and Opera do work. One of the computers is running Windows 7 Ultimate SP 1, the other two are running Windows 7 Professional SP 1. Most other Windows 7 boxes I have tested, however, do not show the bug, so I realize this is going to be very difficult to debug.

On my app, if I get a reference to a button view and run

SC.run(function() { 
    view.triggerAction("mousedown");
});

the button does click. So somehow the clicks are not triggering that event correctly.

Has anyone else experienced this and/or knows of a solution?


Edit: Looking around at other sites that use SproutCore, I find that the SC Buttons at the top of http://www.bong.tv/ do not work, but the demo site http://tasks.sproutcore.com/tasks does work. I have not yet worked out what's different about the Tasks buttons (nor what version of SC it uses).


Solution

  • Okay sounds like we can promote this to an official answer then. This is a known bug in SproutCore (see here). The problem is a combination of SC's longstanding separation of touch and click behavior, and the current total unreliability of all actual touch detection (as opposed to detection of the presence of the API). We're working on a solution. In the mean time, the best (total hack of a partial) solution appears to be detect SC.browser.os === "windows" and SC.browser.osVersion of "6.2" (win8) or "6.1" (win7), and manually set SC.platform.touch = NO at the top of your project's core.js. This will fix things for your Win7 & Win8-with-mouse users, but I believe will break them for your Win8-on-tablet users.

    Again, definitely not optimal, and we're going to try to have a fix, or a hack, in place for version 1.10.1.