ftlabs / fastclick

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

input type=file display:'none' class='needsclick'。input.click() won‘t work #580

Open USTCLX opened 5 years ago

USTCLX commented 5 years ago

I think FastClick.prototyp.onClick method has a bug. The targetElement has not been reassigned to event.target。 I think it should be like this

FastClick.prototype.onClick = function (event) {
    var permitted;
    this.targetElement = event.target;          // here reassign this.targetElement
    if (this.trackingClick) {
        this.targetElement = null;
        this.trackingClick = false;
        return true;
    }
         ....
 }
spreadzz commented 4 years ago

This is a serious issue, I am experiencing it too. When will it be fixed?

Setting the class "needsclick" on the input[type="file"] does not work.

snnairow commented 4 years ago

我也遇到了