udos86 / ng-dynamic-forms

Rapid form development library for Angular
ISC License
1.32k stars 369 forks source link

File Upload Doesn't Work In Angular Material #1161

Open FI55 opened 2 years ago

FI55 commented 2 years ago

I'm submitting a


[x] Bug / Regression
[ ] Feature Request / Proposal

I'm using


NG Dynamic Forms Version: `15.0.0`

[ ] Basic UI
[ ] Bootstrap UI  
[ ] Foundation UI
[ ] Ionic UI
[ ] Kendo UI
[x] Material  
[ ] NG Bootstrap
[ ] Prime NG

Description

In the documentation is File Upload is supported by setting the inputType to "file" but when that is done Angular Material complaints that it doesn't accept that:

ERROR Error: Input type "file" isn't supported by matInput.
    at getMatInputUnsupportedTypeError (input.mjs:25:12)

The solution can be found in this answer: https://stackoverflow.com/a/64598305

For Angular Material the File Upload Input has to be placed outside of the mat-form-field, like this it still includes the value into the FormGroup. If you can give me directions on where to fix it, I can fix the issue and post a PR?