Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Password: TypeError: Cannot read properties of undefined (reading 'inputStyle') #15717

Closed
MAN-Sendance opened this issue May 28, 2024 · 2 comments
Labels
Resolution: Needs More Information More information about the issue is needed to find a correct solution

Comments

@MAN-Sendance
Copy link

Describe the bug

I have the following code for adding a password field to my application:

<div class="form-control-group">
            <label class="block font-semibold mb-2" for="login-password"
              >Password</label
            >
            <span class="p-input-icon-left inline">
              <mat-icon
                aria-hidden="false"
                aria-label="password icon"
                class="material-icons-outlined -translate-y-50 top-50 absolute ml-2"
                fontIcon="lock"
              />
              <input
                #password="ngModel"
                [(ngModel)]="user.password"
                [attr.aria-invalid]="
                  password.invalid && password.touched ? true : null
                "
                [required]="
                  getConfigValue('forms.validation.password.required')
                "
                [feedback]="false"
                aria-describedby="password-help"
                class="w-full"
                [ngClass]="{
                  'mb-3':
                    password.valid || password.untouched || !password.dirty
                }"
                id="login-password"
                name="login-password"
                pPassword
                placeholder="Password"
                type="password"
              />
            </span>
            <ng-container
              *ngIf="password.invalid && password.touched && password.dirty"
            >
              <div id="password-help" class="text-red-500 mb-3 mt-1">
                <span class="text-sm">{{
                  password.errors?.['required']
                    ? 'Password is required!'
                    : 'Invalid input!'
                }}</span>
              </div>
            </ng-container>
          </div>

It had been working perfectly until it suddenly stopped working in v17.16.0

Environment

don't know what to tell

Reproducer

No response

Angular version

17.3.4

PrimeNG version

17.17.0

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

20.13.1

Browser(s)

All

Steps to reproduce the behavior

No response

Expected behavior

pPassword directive should work again ...

@MAN-Sendance MAN-Sendance added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label May 28, 2024
@mehmetcetin01140 mehmetcetin01140 added Resolution: Needs More Information More information about the issue is needed to find a correct solution and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Jun 7, 2024
@mehmetcetin01140
Copy link
Contributor

Hi,

Could you please share a stackblitz example so we can identify the issue clearly?

@MAN-Sendance
Copy link
Author

It seems to have been unexpectedly fixed in any version > 17.16.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Needs More Information More information about the issue is needed to find a correct solution
Projects
None yet
Development

No branches or pull requests

2 participants