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

Problem with detection of L.Browser.touch in some desktop browsers #5407

Closed
NielsHolt opened this issue Mar 23, 2017 · 1 comment
Closed

Comments

@NielsHolt
Copy link
Contributor

NielsHolt commented Mar 23, 2017

It seems that the detection of browser support for touch-event isn't consistent on some desktop browser
On IE11 and Chrome it get set to true while on Firefox it is set to false

Monernizr (https://modernizr.com) use another methods to detect the presents of touch-event and it returns false for all tree browsers:

function() {
    var bool;
    if (('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch) {
      bool = true;
    } else {
      // include the 'heartz' as a way to have a non matching MQ to help terminate the join
      // https://git.io/vznFH
      var query = ['@media (', prefixes.join('touch-enabled),('), 'heartz', ')', '{#modernizr{top:9px;position:absolute}}'].join('');
      testStyles(query, function(node) {
        bool = node.offsetTop === 9;
      });
    }
    return bool;
  });
@IvanSanchez
Copy link
Member

Duplicate of #5266, #3944 and others.

Not going to take action on this due to the recent work done in the pointerify branch, because worrying about PointerEvents is way more promising than worrying about TouchEvents

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

2 participants