question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot disable fastclick on a particular element

See original GitHub issue

Need the possibility of disabling fastclick on a specific element.

My particular case was an input type file that is hidden, but the label is used as a button to activate it.

e.g.


<label htmlFor="addFileInput" >
  <i className="icon-add-1" />
</label>
<input className="hidden" id="addFileInput" type="file" accept="image/*" onChange={this.handleUploadFile} ref={ref => { this.fileInput = ref; }} />

pull request coming…

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:1
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
simonrobbcommented, Oct 18, 2017

I’m having the same trouble.

Some browsers prevent file inputs from being triggered by client code as a security measure. Try triggering a click event in the console using document.querySelector('input[type=file]').click() and it’ll work, do the same from your code and it will mysteriously fail.

When the library proxies a touch event to the native label onclick functionality, client code is triggering the file input opening and so it’s being blocked by the browser.

0reactions
shane-xicommented, Mar 18, 2019

我后来也是干掉了react-fastclick,直接用的fastclick解决的 @zongzi531

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is there a way to prevent fastclick from firing “active” state on ...
The method is to attach a touchstart event to the element you want touchable. Once the touchstart event has fired, the event handler ......
Read more >
How to remove Fastclick.net - BugsFighter
Remove Fastclick.net from websites, allowed to show push-notifications in Google Chrome · Go to Google Chrome settings, by clicking 3-dots icon ...
Read more >
fastclick - npm
FastClick is a simple, easy-to-use library for eliminating the 300ms delay between a physical tap and the firing of a click event on...
Read more >
https://dev.entrouvert.org/attachments/download/13...
indexOf('BB10') > 0; - - /** - * Determine whether a given element ... toLowerCase()) { - - // Don't send a synthetic...
Read more >
How to delay JavaScript until user interaction in WordPress
Delay specific JavaScript files by adding the source URL ( example.js ), or delay ... Above are just a few of the many...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found