Page 1 of 1

md-inputfield class not working for pInputNumber

Posted: 24 Nov 2020, 10:28
by info@smart-jack.com
PrimeNG version: 9.0.2
Template: Sapphire

When using the md-inputfield class, the pInputNumber and pInputText elements look different so I can't use it in a form if I want to maintain the same style.

Code: Select all

<span class="md-inputfield">
   <input
         id="text-input"
         type="text"
         pInputNumber
          [(ngModel)]="someField"
    />
   <label for="text-input">I'm a pInputText</label>
</span>

Code: Select all

<span class="md-inputfield">
   <input
          style="min-width: 300px;"
         id="number-input"
         type="number"
         pInputNumber
          [(ngModel)]="someOtherField"
    />
   <label for="number-input">I'm an pInputNumber</label>
</span>
Image

Re: md-inputfield class not working for pInputNumber

Posted: 24 Nov 2020, 12:14
by mert.sincan
Hi,

Please try p-float-label instead of md-inputfield; https://primefaces.org/primeng/showcase/#/floatlabel

Best Regards,

Re: md-inputfield class not working for pInputNumber

Posted: 24 Nov 2020, 13:35
by info@smart-jack.com
This class doesn't seem to exist in the version I'm using (9.0.2) and I can't upgrade now.

Re: md-inputfield class not working for pInputNumber

Posted: 02 Dec 2020, 09:23
by mert.sincan
Thanks a lot for the update! @merve could you please check this issue with 9.0.2?

Best Regards,

Re: md-inputfield class not working for pInputNumber

Posted: 01 Feb 2021, 14:07
by mert.sincan
Hi @info@smart-jack.com

PrimeNg has no pInputNumber directive. We added <p-inputNumber component on 9.1.0. Could there be a misunderstanding?

When you change the type of input, the browser adds styles to it. Therefore, you need to override the browser's style for <input type="number|other options">.

Best Regards,