primeng icon indicating copy to clipboard operation
primeng copied to clipboard

Component: p-password has incorrect width

Open MAN-Sendance opened this issue 2 years ago • 4 comments

Describe the bug

The password component has a wrong width due to missing width inheritance in the child input field.

incorrect_password_width

Environment

Angular (latest version) PrimeNG (latest version) Primeflex (latest version)

Reproducer

No response

Angular version

16.1.4

PrimeNG version

16.0.2

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

18.16.0

Browser(s)

No response

Steps to reproduce the behavior

<label for="email1" class="block text-900 font-medium mb-2"
  >Email</label
>
<input
  pInputText
  id="email1"
  type="text"
  placeholder="Email address"
  class="w-full mb-3"
/>

<label for="password1" class="block text-900 font-medium mb-2"
  >Password</label
>
<p-password
  [feedback]="true"
  [toggleMask]="true"
  id="password1"
  placeholder="Password"
  class="w-full mb-3 block"
/>

Expected behavior

Applying the following styles fixed the issue for me

.p-password {
  width: inherit;
}
.p-password-input {
  width: inherit;
}

MAN-Sendance avatar Jul 21 '23 09:07 MAN-Sendance

This is still an issue for me

image

calumk avatar Dec 27 '23 22:12 calumk

To make it work I had to set both: style and inputStyle:

[inputStyle]="{'width': '100%'}" [style]="{'width': '100%'}" 

barteltm avatar Mar 05 '24 09:03 barteltm

For me this is still an issue. The fixes above worked though.

AutoAwesome avatar Oct 21 '24 23:10 AutoAwesome

I think you just need to use fluid.

For me using Vue this works:

<Password
  id="password"
  name="password"
  placeholder="Password"
  class="mt-2"
  toggle-mask
  fluid
></Password>

molnarerwin avatar Nov 12 '24 08:11 molnarerwin

Hi,

So sorry for the delayed response! Improvements have been made to many components recently, both in terms of performance and enhancement. Therefore, this improvement may have been developed in another issue ticket without realizing it. You can check this in the documentation and try the latest PrimeNG version(v19). If there is no improvement on this, can you open a new issue so we can include it in our roadmap?

Thanks a lot for your understanding! Best Regards,

mertsincan avatar Dec 25 '24 13:12 mertsincan