ftlabs / fastclick

Polyfill to remove click delays on browsers with touch UIs
MIT License
18.66k stars 3.23k forks source link

Cannot read property 'style' of null | iOS #553

Open cibulka opened 6 years ago

cibulka commented 6 years ago

When Google Chrome's developer tools emulate anything running on iOS (iPhone 5 and up, iPads), this error appears on console:

TypeError: Cannot read property 'style' of null
    at Function.FastClick.notNeeded (app.dev.js:2021)
    at new FastClick (app.dev.js:1334)
    at FastClick.attach (app.dev.js:2054)
    at Object.16.cibulka-js/ajax/base.js (app.dev.js:2479)
    at s (app.dev.js:1)
    at app.dev.js:1
    at Object.11.app.js (app.dev.js:1030)
    at s (app.dev.js:1)
    at e (app.dev.js:1)
    at app.dev.js:1

Any other environment - such as desktop browsers, Android emulators, etc. - runs without error.

I'm using fastclick with Browserify:

var attachFastClick = require('fastclick');
attachFastClick(document.body);

Maybe it is connected to this in some way? https://github.com/ftlabs/fastclick/issues/514

Thanks in advance!

he5050 commented 6 years ago

me too error message:

Uncaught TypeError: Cannot read property 'style' of undefined at Function../node_modules/fastclick/lib/fastclick.js.FastClick.notNeeded (fastclick.js:792) at new FastClick (fastclick.js:105) at Function../node_modules/fastclick/lib/fastclick.js.FastClick.attach (fastclick.js:825) at Module../app/index.js (index.js:20) at __webpack_require__ (bootstrap:772) at fn (bootstrap:130) at Module../.ream/entry.js (entry.js:2) at __webpack_require__ (bootstrap:772) at fn (bootstrap:130) at Module../.ream/create-app.js (bootstrap:945)