Why some SPA ceased to support touch events on touch laptops

    Maybe I just now saw, and all have long known, but it appears that Chrome 70 made here is: of The ontouch * of APIs default to disabled on desktop

    Accordingly, if in your code you have relied on the presence of key 'ontouch *' in the document or window , your code will no longer determine what works on the touch device.

    I ran into a typo:

    var isTouchDevice = (('ontouchstart'inwindow) || (navigator.MaxTouchPoints > 0) || (navigator.msMaxTouchPoints > 0));
    

    And when the first condition ceased to be true, the second fucked up. It should have been navigator.maxTouchPoints

    And here, for example, in jQuery UI Touch Punch 0.2.3 , this code is used:

      $.support.touch = 'ontouchend'indocument;
    

    Accordingly, support is also lost.

    Also popular now: