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: Invalid PT props #6404

Closed
imnash21 opened this issue Apr 17, 2024 · 8 comments · Fixed by #6409, #6412, leoo1992/GeradorQRCode#23 or leoo1992/GeradorQRCode#27
Closed

Password: Invalid PT props #6404

imnash21 opened this issue Apr 17, 2024 · 8 comments · Fixed by #6409, #6412, leoo1992/GeradorQRCode#23 or leoo1992/GeradorQRCode#27
Assignees
Labels
Component: Documentation Issue or pull request is related to Documentation Component: Unstyled Issue related to unstyled/passthrough attributes Type: Bug Issue contains a defect related to a specific component.
Milestone

Comments

@imnash21
Copy link

imnash21 commented Apr 17, 2024

Describe the bug

In the Features Tab you can see the invalid prop can call directly but not, when I read the API Tab you can call the "invalid" inside pt prop. That's why I got an error everytime I call "invalid" directly.

IMG_20240417_113144

IMG_20240417_113452

Reproducer

No response

PrimeReact version

10.6.3

React version

18.x

Language

TypeScript

Build / Runtime

Vite

Browser(s)

No response

Steps to reproduce the behavior

No response

Expected behavior

No response

@imnash21 imnash21 added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Apr 17, 2024
@Rekl0w
Copy link
Contributor

Rekl0w commented Apr 17, 2024

#6407 i created pull request for this.

@melloware melloware added Component: Unstyled Issue related to unstyled/passthrough attributes and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Apr 17, 2024
@melloware melloware added this to the 10.6.4 milestone Apr 17, 2024
melloware added a commit to melloware/primereact that referenced this issue Apr 17, 2024
@melloware melloware changed the title Incorrect information/guide for Password component Password: Invalid PT props Apr 17, 2024
@melloware melloware added the Component: Documentation Issue or pull request is related to Documentation label Apr 17, 2024
@melloware
Copy link
Member

@Rekl0w i fixed this the right way by removing those two PT props. If you want to use invalid in PT you would use the props.invalid on the input PT object

@Rekl0w
Copy link
Contributor

Rekl0w commented Apr 17, 2024

@melloware You deleted it from pt options but now there is no explanation for invalid at props too. I can add to there.

@melloware
Copy link
Member

OH those props were just in the wrong place. I will fix.

@melloware
Copy link
Member

They were in PT when they should have been in main props.

@Rekl0w
Copy link
Contributor

Rekl0w commented Apr 17, 2024

Okay but he mentioned that if he calls directly invalid, it gets error. That's why i added invalid={true}

@melloware
Copy link
Member

melloware commented Apr 17, 2024

yeah but that is not correct. here is the proper way to use invalid with Passthrough.

https://stackblitz.com/edit/xmhzeu?file=src%2FApp.jsx

      <Password
        invalid
        pt={{
          input: ({ props }) => {
            if (props.invalid) return 'invalid-css-class';
          },
        }}
      />

that will add the invalid-css-class to the Password only if its invalid.

@imnash21
Copy link
Author

Thank you for responses, now I can continue to work and test it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment