Cannot disable fastclick on a particular element
See original GitHub issueNeed 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:
- Created 6 years ago
- Reactions:1
- Comments:10 (2 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.我后来也是干掉了react-fastclick,直接用的fastclick解决的 @zongzi531