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

Already on GitHub? Sign in to your account

ajax:aborted:file is not being fired for non-blank file field #271

fletcherm opened this Issue Aug 17, 2012 · 3 comments


None yet
3 participants

We're running into an error while using the newest remotipart (1.0.2) and jquery-rails (2.1.0) gems.

As you know, remotipart hooks into the ajax:aborted:file event to do its business. Even though we have the file field populated, we're not seeing the event fired on line 370 of rails.js. nonBlankFileInputs is coming back false.

Digging into the implementation of the blankInputs function, line 260 is resulting to false and the file input isn't being added to the list of good inputs.

We tried changing the == to a && and it worked for our small little form (with only a file field), but that causes tests to fail. At this point we've hit the boundaries of our understanding, so we're hoping someone else here can patch it up.



JangoSteve commented Aug 18, 2012

Thanks for reporting this. Because the test suite for jquery-ujs is a javascript test suite, testing non-blank file fields is the one thing that isn't tested here (since we can't actually make a file field non-blank using javascript). I did add a test for it though in the demo app I use to integration test the jquery-rails gem.

Ah ha! I did see your commented out test in this test suite - commented out because of security limitations. I thought "damn, he tried, too bad we couldn't have the test here to have our backs!" I didn't know about the other repository with the integration test. Nice thinking!

Thanks for patching this up. We'll try it soon.

just tried it. works great now! Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment