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

Missing PT Option for IconField in Password #6555

Closed
sja-cslab opened this issue May 3, 2024 · 16 comments · Fixed by #6560
Closed

Missing PT Option for IconField in Password #6555

sja-cslab opened this issue May 3, 2024 · 16 comments · Fixed by #6560
Assignees
Labels
Type: Bug Issue contains a defect related to a specific component.
Milestone

Comments

@sja-cslab
Copy link
Contributor

sja-cslab commented May 3, 2024

Describe the bug

Relates to #6349 - fixed by @melloware in #6493.
The point here is that I'm using <Password> within display: flex, and I'm no longer able to let the input grow. The reason is that there is no PT option within <Password> to give any className down to IconField.

The relevant code can be found in password

Reproducer

https://primereact.org/password/#togglemask

PrimeReact version

10.6.4

React version

18.x

Language

ALL

Build / Runtime

Vite

Browser(s)

No response

Steps to reproduce the behavior

No response

Expected behavior

No response

@sja-cslab sja-cslab 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 3, 2024
@nitrogenous nitrogenous added Type: Bug Issue contains a defect related to a specific component. and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels May 3, 2024
@KirilCycle
Copy link
Contributor

KirilCycle commented May 3, 2024

Hi there! Can I take it? I want to clarify something, when updating PT options for password, I also need to update password PT options in PASS THROUGH tab in documentation?

@melloware
Copy link
Member

The docs automatically update from the .d.ts changes

@nitrogenous
Copy link
Contributor

Hi there! Can I take it? I want to clarify something, when updating PT options for password, I also need to update password PT options in PASS THROUGH tab in documentation?

Of course!

@nitrogenous
Copy link
Contributor

@KirilCycle Can you give me an estimated time for this task? I was planning to release a new version for some of the bugs today

@KirilCycle
Copy link
Contributor

KirilCycle commented May 3, 2024

@KirilCycle Can you give me an estimated time for this task? I was planning to release a new version for some of the bugs today

Well, ill try to push the PR within 3 hours+-

@melloware
Copy link
Member

Nice teamwork @KirilCycle !

@sja-cslab
Copy link
Contributor Author

Thanks, @KirilCycle. I've just updated to 10.6.5, and the pt option is indeed available now. However, className does not get rendered.

e.g. the following:

pt={{
        input: { className: "flex-1" },
        iconField: { className: "flex-1" }
   }}

Resulting in:
image

@melloware
Copy link
Member

@sja-cslab because it's an InputText you have to do "input: { root: { className: "test" } }"

@sja-cslab
Copy link
Contributor Author

sja-cslab commented May 6, 2024

@melloware if you are talking about someting like

pt={{
        input: { root: { className: "qwertz" } },
        iconField: { className: "flex-1" }
   }}

that does not help and not even work (in case this nesting is even possible) - however, I'm not interested in the InputText.
The div.p-icon-field is the parent I need to add a class to, that was my intention with this issue here

@sja-cslab
Copy link
Contributor Author

sja-cslab commented May 6, 2024

@melloware here's a stackblitz so you may understand my intention

@melloware
Copy link
Member

Did you try iconField with "root" it's the same principal as input.

@sja-cslab
Copy link
Contributor Author

@melloware good hint, that's working - stackblitz updated. Ty.

pt={{ input: { className: 'flex-1' }, iconField: { root: { className: 'flex flex-1' }, }, }}

@melloware
Copy link
Member

Ok great! It's whenever you are passing through to another subcompnent of a component like IconField or InputText it needs to be root.

@sja-cslab
Copy link
Contributor Author

sja-cslab commented Jul 4, 2024

pt={{
    input: { className: "flex-1" },
    iconField: {
        root: { className: 'flex flex-1' },
    }
}}

works if the parent of that password is display: flex and allows growing. So if you use Floating labels, you password got nested one more level i think so you need to pass flex to this

@ezescigo
Copy link

ezescigo commented Jul 4, 2024

Have you noticed the icon weirdly positioned?
image
image

@sja-cslab
Copy link
Contributor Author

sja-cslab commented Jul 4, 2024

Update your theme that's how it should look in 10.7
image

If you need more help please join Discord and try to find it there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a defect related to a specific component.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants