-
Notifications
You must be signed in to change notification settings - Fork 508
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
button_to data-confirm shows confirmation twice, but does not send the form #467
Comments
Oh, jquery-rails is 3.1.4, btw. |
If you're looking to submit the form after a confirmation, I recommend using the |
@alextaylor000 button_to generates form with a |
@phillipp Oops, apologies, I assumed you were using it explicitly within another form element. It looks like this issue has been fixed in the latest version (see this commit which made the button click listeners more explicit). I just verified the expected behaviour in my environment. |
I still get this issue of two dialog boxes. Here is my code.
The above when clicked shows a dialog, I click OK, then it shows up the second time. Rails 6.0 jquery-rails 4.3.5 |
Hi,
I'm using the button_to like this:
Now I expected that it would ask the confirmation once and submit the form. What happens instead is that the confirmation shows up twice and the form is not submitted.
Looking at the stack traces I saw that events for two different selectors: formInputClickSelector and buttonClickSelector
The confirmation prompt is then called from lines 383 and 447 respectively. I dont understand how the original control flow should look like, but maybe there is an easy fix? I would be happy to submit a PR if you could give me a hint where to look at.
The text was updated successfully, but these errors were encountered: