meteor-autoform-file icon indicating copy to clipboard operation
meteor-autoform-file copied to clipboard

Not working on Firefox

Open rpesciotta opened this issue 8 years ago • 8 comments

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?

rpesciotta avatar Mar 31 '16 07:03 rpesciotta

Hi @rpesciotta @yogiben Any fix for this yet ?

olumytee avatar Apr 26 '16 22:04 olumytee

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

derdaumen avatar May 02 '16 08:05 derdaumen

Have the same problem, no click action for FF

kolyasya avatar May 23 '16 08:05 kolyasya

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

yAnn1ck-B avatar May 23 '16 12:05 yAnn1ck-B

Same here:

brylie avatar May 26 '16 13:05 brylie

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.

brylie avatar Jun 02 '16 08:06 brylie

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

jonathascarrijo avatar Mar 07 '17 03:03 jonathascarrijo

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:

  • http://stackoverflow.com/questions/33420402/file-input-field-inside-button-doesnt-work-in-firefox
  • https://www.w3.org/TR/REC-html40/interact/forms.html#edef-BUTTON

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!

mahfuzmohammad avatar Mar 15 '17 20:03 mahfuzmohammad