udos86 / ng-dynamic-forms

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

Dynamic forms version 16.0.0 renders Input incorrectly #1166

Closed Diaaz closed 1 year ago

Diaaz commented 1 year ago

I'm submitting a


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

I'm using


NG Dynamic Forms Version: `16.0.0`

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

Description

Input controls are not rendered correctly in Angular Material 15.0.1. An input is rendered, but it is not a Material input and when typing the placeholder is not removed and the entered text is shown on top it.

Typescript: this.testModel = [ new DynamicInputModel({ id: "sampleInput", label: "Sample Input", maxLength: 42, placeholder: "Sample input" }), ]; this.testFormGroup = this.formService.createFormGroup(this.testModel); Html:


<form [formGroup]="testFormGroup">
  <dynamic-material-form [group]="testFormGroup" [model]="testModel"></dynamic-material-form>
</form>```
Diaaz commented 1 year ago

@udos86 I think the problem is the line:

import { MatLegacyInput as MatInput } from "@angular/material/legacy-input";

in file ng-dynamic-forms/ui-material/src/lib/input/dynamic-material-input.component.ts.

Material 15 changed many class-names. E.g: mat-input-element to mat-mdc-input-element. It seems MatLegacyInput uses the old class-names, which are not available in the build.

DrEppen commented 1 year ago

Really need this too! Is there any progress?

danjor commented 1 year ago

I also really need this to be released. https://github.com/udos86/ng-dynamic-forms/pull/1168

udos86 commented 1 year ago

Just released 17.0.0 which includes #1168 and a couple of fixes to that.

If there are any bugs left, please open a pull request.

Diaaz commented 1 year ago

Thank you!

danjor commented 1 year ago

Thank you!