yogiben / meteor-autoform-file

Upload and manage files with #autoForm
MIT License
92 stars 101 forks source link

Not working on Firefox #104

Open rpesciotta opened 8 years ago

rpesciotta commented 8 years ago

Hi,

I got a form working perfectly, testing on Chrome. But if I open the same page/form with Firefox, the "Choose file" button does not trigger any action, that is, I don't see the dialog for selecting a file. I switched to firefox debugger, and I see when I click on the referred button, this piece of code is called in jQuery.js:

if ( !(eventHandle = elemData.handle) ) {
            eventHandle = elemData.handle = function( e ) {
                // Discard the second event of a jQuery.event.trigger() and
                // when an event is called after a page has unloaded
                return typeof jQuery !== strundefined && (!e || jQuery.event.triggered !== e.type) ?
                    jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
                    undefined;
            };
            // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events
            eventHandle.elem = elem;
        }

And apparently, it's always returning undefined in firefox. Is this a known issue? Am I missing something?

olumytee commented 8 years ago

Hi @rpesciotta @yogiben Any fix for this yet ?

derdaumen commented 8 years ago

I experience the same problem. I'm new to all of this github packages pull jazz. How can I help to fix this?

kolyasya commented 8 years ago

Have the same problem, no click action for FF

yAnn1ck-B commented 8 years ago

same here, not working in ff and ie, only chrome

brylie commented 8 years ago

Same here:

brylie commented 8 years ago

As an aside, we migrated to a different file upload solution called Meteor FileCollection. FileCollection also uses GridFS, and the UI can be configured with drag-and-drop support.

jonathascarrijo commented 7 years ago

A year has passed, and still no fix. Is this package abandoned?

mahfuzmohammad commented 7 years ago

Hi everyone, recently I used this module and found the similar problem. After some research I think I know what is happening.

Why it's not working in firefox or IE? If you check the source code, more specifically autoform-file.html file, there is a template called afFileSelectFileBtnTemplate. Here the input field is used inside a button. After some research, it seems like an input field inside a button is not allowed in HTML.

References:

My proposed solution It seems like the template should be updated but I have done another way in my case. I added a listener that listened the click event for the button and fires another click event for the input field. The code is given below:

'click button.af-select-file.js-af-select-file': function(event, template) {
    $(event.target).find("input.js-file").click();
}

I wanted to give a fix to this problem and I would like to have suggestion from @yogiben

Thank you!