Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

ENYO-789: better fix for Chrome on Android, using document.elementFro…

…mPoint with proper scaling applied to coordinates. Fixes issues with pickers not working.

Enyo-DCO-1.0-Signed-Off-By: Ben Combee (ben.combee@palm.com)
  • Loading branch information...
commit e208965cb94baa201ed922d24b811a4db6293170 1 parent ffe1389
Ben Combee authored
Showing with 8 additions and 3 deletions.
  1. +8 −3 source/touch/touch.js
View
11 source/touch/touch.js
@@ -100,9 +100,14 @@ enyo.requiresWindow(function() {
document[e] = enyo.dispatch;
});
// use proper target finding technique based on feature detection.
- // HACK: on Chrome for Android v18 on devices with higher density displays,
- // document.elementFromPoint fails because of an internal scaling problem.
- if (!document.elementFromPoint || enyo.platform.androidChrome <= 18) {
+ if (enyo.platform.androidChrome <= 18) {
+ // HACK: on Chrome for Android v18 on devices with higher density displays,
+ // document.elementFromPoint uses wrong pixel system, so manually scale
+ var dpr = window.devicePixelRatio;
+ this.findTarget = function(inX, inY) {
+ return document.elementFromPoint(inX * dpr, inY * dpr);
+ };
+ } else if (!document.elementFromPoint) {
this.findTarget = function(inX, inY) {
return this.findTargetTraverse(null, inX, inY);
};
Please sign in to comment.
Something went wrong with that request. Please try again.