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

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

Closed
fletcherm opened this issue Aug 17, 2012 · 3 comments
Closed

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

fletcherm opened this issue Aug 17, 2012 · 3 comments

Comments

@fletcherm
Copy link

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.

Thanks!

@JangoSteve
Copy link
Member

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.

@fletcherm
Copy link
Author

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.

@ghost
Copy link

ghost commented Aug 18, 2012

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants