State object is not available in Password component for Ref - Version8.7.3

UI Components for React
Post Reply
Jyothy
Posts: 1
Joined: 24 Feb 2023, 15:23

24 Feb 2023, 19:48

Hello Team,
Our team recently upgraded primereact version from 7.2.0 to 8.7.3. In Password component, we are facing issue after latest upgrade. We have using Password Meter in password form . In our application, we are using a Reset button for clearing all data in the forms which include password form too. But after resetting, when we click on the password form, we can see the previous state, that means we can see the meter with previous password strength. To fix this issue, we were using a reference in Password component. While resetting we are using the following logic to reset password meter to null.

passwordRef.current.state.meter = null,

Here passwordRef is the ref which we are using in the Password component. In 7.2.0 version state object were available. I am attaching the screenshot.

Image

After the upgrade to 8.2.0 the state object is not available. We are facing a problem here (how to reset meter value) and this is critical for us. I am attaching the screenshot for after upgrading to 8.2.0

[url=https://ibb.co/1ZSTmzW]Image[/url

Please provide the solution for this problem. Thank you.

Melloware
Posts: 3532
Joined: 22 Apr 2013, 15:48

07 Mar 2023, 19:19

In 8.7.3 is in in the `props` object of the `current` ?
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 12.0.0 / PF Extensions 12.0.3
PrimeReact 8.7.3

Melloware
Posts: 3532
Joined: 22 Apr 2013, 15:48

07 Mar 2023, 19:21

Actually you probably need to request a `reset` method added to the interface to acheive what you want. Access to internals is no longer really allowed going forward.
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 12.0.0 / PF Extensions 12.0.3
PrimeReact 8.7.3

Post Reply

Return to “PrimeReact”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests