Closed ghost closed 12 years ago
Confirmed in iOS6 (emulator at least). Added test case.
I am noticing after the fix above, that I have to hit the enter key twice in the ios6 emulator for it to submit.
I can't reproduce that, I only have to hit enter once in iOS6 emulator (iPad and iPhone): http://ftlabs.github.com/fastclick/tests/18.html
Ah, your test is including version 0.3.0, while on my side I am including 0.3.2 (https://raw.github.com/ftlabs/fastclick/master/lib/fastclick.js). Please update your test with the newest version and you will reproduce the double enter issue.
OK, I've updated the public pages so that the test loads 0.3.2 and I can reproduce the issue.
Should be fixed. It seems when the enter key is hit on a hard keyboard or the Go button on the soft keyboard is tapped then a 'fake' click event will be dispatched, by Safari itself, to the submit-type input element (if one is present) and if preventDefault
is called on this click event then the form will not be submitted.
Confirmed, 0.3.3 fixed my issue with double enter. Thanks
Hitting enter on an input field no longer executes the form submit event after instantiating FastClick.