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
material2 not support input file upload #3262
Comments
|
This is not currently on our roadmap |
|
I was looking for the same; however, the workaround is simple: use a md-button to trigger a hidden input: |
|
That's what I ended up using @HoumanKml. Another problem is to do that with reactive forms, but that's another story 👍 |
|
Since it isn't (and will not be) part of the roadmap, I made my own |
|
Don't have the time to try it out right now but thx for sharing @merlosy! |
|
Style the button for 4.4.3 & material 2 build 12 (real pain to keep up with breaking changes...hate angular sometime)
css part
|
|
Based on the new guidelines, I updated my gist with custom input file working with Angular 4.4.x + Material Beta 12 https://gist.github.com/merlosy/ab33dd7edaacfd92d6c9a5daea0a1240 |
|
@merlosy nice update thanks |
|
@merlosy thanks for sharing. The referenced plunker is not loading. |
|
@misamae updated for Angular 5 and material 5.0.0-RC.0: |
|
Hey merlosy. I like your control. |
|
nice solution @merlosy |
|
somehow I see ERROR Error: mat-form-field must contain a MatFormFieldControl. exception on @merlosy solution implementation :( |
|
Hey @merlosy your latest plnkr is not loading anymore :( |
|
i have a problem show the file in the placeholder... |
|
Ill look into it. Ill post an update here when it's fixed :) |
|
Thanks, @merlosy for your idea, I made it work for my app but it would be good that the plunkr is working also :) It seems like there is a broken script. |
|
Plunker is working again! The code didn't changed, just broken imports since release of Material 5.0.0 |
|
@merlosy nice! You should publish it as a module on Github and NPM. |
|
@HunderlineK Your solution auto focuses the initial button that calls the hidden button when you finish uploading. Do you have any idea to get out of the focus? |
|
@kamok I haven't worked with angular in a long time, but I suppose you can monitor the status of the file upload event and then after the upload do whatever you like to do, or maybe use merlosy's solution, It seems more robust to me |
|
@merlosy 's component works like a charm, but i encountered this error every time i submitted a file to the input |
|
@marklagendijk Your wish has been real: https://github.com/merlosy/ngx-material-file-input |
|
Hi! I'm getting this error on using @merlosy 's solution Help will be appreciated! |
|
The solution suggested by @HunderlineK is working perfectly for me. I went ahead and put together a simple Stackblitz sample. |
Not sure why this is not in the roadmap. File input types are equally important. |
|
FYI, for those that are delegating the input file click (a la @leonlovett solution) : This does not work on Safari Mobile :( |
|
I've just stumbled over this after having the same issue with Angular 7 without using Material where Using the |
|
Any updates on this? Why this has been closed?... |
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Input type "file" isn't supported by md-input-container.
The text was updated successfully, but these errors were encountered: