Closed antoniogarcez closed 7 years ago
Same problem on Android 7.1.2
Plus could you put together a jsFiddle or similar which shows this behaviour?
This is a jsFiddle that represents my problem...
https://jsfiddle.net/uskgmdtg/3/
I've tested in my computer and also didn't work.
Thank you, @antoniogarcez. The issue is that the special events provided by this library do not work with the browser in terms of triggering them for inputs and other items (they're essentially a composite of various events).
To fix your issue, you can simply trigger click
on your hidden input:
https://jsfiddle.net/uskgmdtg/4/
@benmajor, thank you for information.
When I saw that .trigger('tap')
didn´t work, I was starting using .trigger('click')
and worked. I thought that .trigger('tap')
should work.
Unfortunately not, it's one of the perils of this polyfill method. Hopefully using click
suffices.
An advice, please correct the documentation because will mislead developers. You have this in your documentation:
Triggering the event:
$('#myElement').trigger('tap');
Hi @benmajor ,
Did you do any correction? Today, I've tested and it works. 👍
Hi Antonio, nothing was changed in the library. Did you upgrade jQuery?
I can not remenber but it's possible. Do you know if they change anything?
Hi,
I am trying to simulate a tap event in a input of type file but isn´t working.
This is my code:
$(ButtonAddAttachmentElem).on('tap', function (event) { $(InputAddAttachmentElem).trigger('tap'); });
I've tested in Google Chrome in a Android 4.4 device.