md-inputfield class not working for pInputNumber

Forum rules
Please note that response time for technical support is within 3-5 business days.
Post Reply
info@smart-jack.com
Posts: 6
Joined: 23 Sep 2019, 10:25

24 Nov 2020, 10:28

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

mert.sincan
Posts: 5281
Joined: 29 Jun 2013, 12:38

24 Nov 2020, 12:14

Hi,

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

Best Regards,

info@smart-jack.com
Posts: 6
Joined: 23 Sep 2019, 10:25

24 Nov 2020, 13:35

This class doesn't seem to exist in the version I'm using (9.0.2) and I can't upgrade now.

mert.sincan
Posts: 5281
Joined: 29 Jun 2013, 12:38

02 Dec 2020, 09:23

Thanks a lot for the update! @merve could you please check this issue with 9.0.2?

Best Regards,

mert.sincan
Posts: 5281
Joined: 29 Jun 2013, 12:38

01 Feb 2021, 14:07

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,

Post Reply

Return to “Sapphire - PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests