Materialize / Meteor - file component not working

467 Views Asked by At

For my project, I've added the jQuery and the Materialize: Materialize packages to my Meteor app. With the file upload button component, I copy/pasted the websites code into a blank template. When I click on the button it allows me to upload a file, but the name won't display next to it, as it does in the example.

I think there might be a problem with jQuery or the materialize.js, but I'm not sure. The wave animations for the buttons are working, which makes me think that materialize.js is fine. Anyone else found a problem like this?

2

There are 2 best solutions below

1
On

I think this is a problem of materialize.js.

0
On

Workaround (add id=fileupload)

'change #fileupload':function(e,v){           
        var fileArray=$(e.target)[0].files;  
        if (fileArray.length){            
           var fileDiv=$(e.target).parent().parent().find('input.file-path');
           fileDiv.val(fileArray[0].name);
        }     
    }