Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Default disable_with on submit_tag breaks the app if the user goes back #26366
Steps to reproduce
The submit button should be enabled.
The submit button retains its
This is a good thing in general – we want state to be retained as we want users to be able to edit their previous submission and resubmit. However with a disabled submit button the app is effectively broken from that point on until they know how to force a refresh (standard refresh doesn’t refresh form state) or can pop open web inspector and manually remove the disabled state.
While I can see the utility of this behaviour it’s absolutely user hostile to make it a default. I note that in the PR that added this (#21135) there wasn’t any discussion of the back button issue.
Hi @robinwhittleton, thanks for reporting this! I think this is more of a jquery-ujs bug, than a Rails/Action View bug. Looks like there was a ticket opened at rails/jquery-ujs a few months ago (rails/jquery-ujs#357), and there was a PR that was merged in (rails/jquery-ujs/pull/385) to try and fix this bug. Would you be willing to test out this patch locally, and see if it fixes the error for you? Thanks again for opening up this issue! :)
The PR you referenced was merged on the 8th Sep 2014 rather than a few months ago
I’ll investigate what’s going on with jquery-ujs when I get some more time.