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

Chrome development tools: Emulating Touch Events not working #1869

Closed
fredj opened this issue Mar 17, 2014 · 1 comment · Fixed by #1870
Closed

Chrome development tools: Emulating Touch Events not working #1869

fredj opened this issue Mar 17, 2014 · 1 comment · Fixed by #1870

Comments

@fredj
Copy link
Member

fredj commented Mar 17, 2014

See https://developers.google.com/chrome-developer-tools/docs/mobile-emulation#emulate-touch-events

I suspect that ol.BrowserFeature.HAS_TOUCH is incorrect.

@fredj
Copy link
Member Author

fredj commented Mar 17, 2014

When the touch screen is emulated:

  • ol.BrowserFeature.HAS_TOUCH == false
  • 'ontouchstart' in window == true

When it's not:

  • ol.BrowserFeature.HAS_TOUCH == false
  • 'ontouchstart' in window == false

We should prbably use the same code as Modernizr: 'ontouchstart' in window instead of 'ontouchstart' in window.document.documentElement

fredj added a commit to fredj/openlayers that referenced this issue Mar 17, 2014
Use goog.global instead goog.global.document.documentElement to avoid
false negative results when using the chrome development tools (Touch
Events emulation).

Code borrowed from https://github.com/Modernizr/Modernizr/blob/master/feature-detects/touchevents.js
except for the DocumentTouch part which is deprecated (https://developer.mozilla.org/en-US/docs/Web/API/DocumentTouch)

Fixes openlayers#1869
fredj added a commit to fredj/openlayers that referenced this issue Mar 17, 2014
Use goog.global instead goog.global.document.documentElement to avoid
false negative results when using the chrome development tools (Touch
Events emulation).

Code borrowed from https://github.com/Modernizr/Modernizr/blob/master/feature-detects/touchevents.js
except for the DocumentTouch part which is deprecated (https://developer.mozilla.org/en-US/docs/Web/API/DocumentTouch)

Fixes openlayers#1869
pgiraud pushed a commit to pgiraud/ol3 that referenced this issue Mar 24, 2014
Use goog.global instead goog.global.document.documentElement to avoid
false negative results when using the chrome development tools (Touch
Events emulation).

Code borrowed from https://github.com/Modernizr/Modernizr/blob/master/feature-detects/touchevents.js
except for the DocumentTouch part which is deprecated (https://developer.mozilla.org/en-US/docs/Web/API/DocumentTouch)

Fixes openlayers#1869
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

Successfully merging a pull request may close this issue.

1 participant