Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Form with a submit button requires double click for submission when SwiftClick is enabled. #8

Open
prashantpalikhe opened this issue Dec 7, 2016 · 7 comments

Comments

@prashantpalikhe
Copy link
Contributor

The issue is replicated on the following bin

http://jsbin.com/vuwukeqapi/

You can load this bin on iOS safari to see the issue.

Basically what's happening is:

  1. on iOS, if the form has a submit button. Clicking on the submit button on the keyboard fires a click event on the submit button.
  2. No touch events are fired.
  3. SwiftClick's click handler handles the event. And, if the _clickedAlready variable is set to true from any previous clicks, the click handler cancels the event. Therefore, cancelling the form submission on the first click.
@munkychop
Copy link
Owner

munkychop commented Dec 7, 2016

@prashantpalikhe thanks for the detailed report. Perhaps buttons with a type of submit should be ignored by SwiftClick. What do you think?

I will, however, consider removing the ghost click prevention code, as this was aimed at quite an old Android version, if I remember correctly.

@prashantpalikhe
Copy link
Contributor Author

@munkychop Swiftclick ignoring won't be enough though. Because the OS fires the click event and the handler executes nevertheless.

Would be awesome if the ghost click prevention is no longer necessary.

@munkychop
Copy link
Owner

@prashantpalikhe this is going to have to wait for a week or so, as I'm crazy busy right now. I will take a look when I get a minute, though.

@munkychop
Copy link
Owner

munkychop commented Apr 28, 2017

@prashantpalikhe while refactoring the whole project into ES2015 I looked into solving this issue, along with #10, while retaining the ghost click prevention.

Would you be able to pull and switch to the es6 branch to test against your specific use cases?

To start the project within that branch you'll need to run npm i and then npm start.

@munkychop
Copy link
Owner

@prashantpalikhe were you ever able to test this?

@prashantpalikhe
Copy link
Contributor Author

Nope, have not been able to.

@munkychop
Copy link
Owner

Ok, I'll try and get some testing done on the weekend, if I can find the time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants