ruhley / angular-color-picker

Vanilla AngularJS Color Picker Directive with no requirement on jQuery
http://ruhley.github.io/angular-color-picker/
MIT License
166 stars 79 forks source link

Touch events not going through on Android/Chrome - or Chrome Device mode #132

Closed dceejay closed 7 years ago

dceejay commented 7 years ago

Hi (version 2.7.1) for some reason touch events are failing to be registered when I use Chrome on Android or Chrome on Desktop in device mode... (ie simulating touch)... I get the error below in the console

Unable to preventDefault inside passive event listener due to target being treated as passive. See https://www.chromestatus.com/features/5093566007214080
preventDefault @ app.min.js:formatted:2079
value @ app.min.js:formatted:59754
value @ app.min.js:formatted:59337
dispatch @ app.min.js:formatted:1956
r.handle @ app.min.js:formatted:1883
app.min.js:formatted:59820Uncaught TypeError: Cannot read property '0' of undefined
    at t.value (app.min.js:formatted:59820)
    at t.value (app.min.js:formatted:59770)
    at t.value (app.min.js:formatted:59384)

Where app.min.js:formatted:59820 corresponds to the snippet below in your code (minified)

    }, {
        key: "getEventPos",
        value: function(o) {
            return 0 === o.type.search("touch") ? o.changedTouches[0] : o
        }
    }, {

Is there a way around this ? (I saw a similar issue closed a while ago... but I'm not sure why this has reappeared now....)