primeng icon indicating copy to clipboard operation
primeng copied to clipboard

InputMask does not display initial value with Reactive Forms

Open cagataycivici opened this issue 9 years ago • 5 comments

If initial value is provided via reactive form, it is not displayed.

cagataycivici avatar Mar 27 '17 15:03 cagataycivici

My bad, it works.

cagataycivici avatar Mar 27 '17 15:03 cagataycivici

For me it doesn't seem to work. Initials values only work for normal <input>-Elements and not for <p-inputMask>-Elements:

component.html

<input pInputText [formControl]="myForm.controls['title']" type="text"/> <!-- foo -->
<p-inputMask [formControl]="myForm.controls['title']" mask="***"></p-inputMask> <!-- is empty -->

component.ts

myForm: FormGroup;

ngOnInit() {
    this.myForm = this.fb.group({
        title: ['foo']
    });
}

rweisse avatar Sep 04 '19 10:09 rweisse

Same here. As soon as I remove the mask, it works. Any updates on this?

wiesnery avatar Nov 04 '19 13:11 wiesnery

Same here. As soon as I remove the mask, it works. Any updates on this?

john182 avatar Jul 23 '20 20:07 john182

Same here:

Template:

<p-inputMask mask="9999.999.999" id="belgianTaxNumber" formControlName="taxNumber" placeholder="9999.999.999"></p-inputMask><!-- 466981655 -->
<input id="taxNumberInput" type="text" pInputText formControlName="taxNumber"><!-- Empty: just seeing placeholder: 9999.999.999 -->

Component:

this.customerForm = this.fb.group({
      taxNumber: [this.customer.taxNumber],

SiebeDom avatar Oct 20 '23 17:10 SiebeDom