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

Fix adornment icon missing when type is set to password in TextFieldAdapter #7439

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

adibmbrk
Copy link
Contributor

Purpose

This PR addresses the issue where the adornment icon is missing when the type is set to password in the TextFieldAdapter component. The root cause of this issue is the InputProps overriding the password visibility toggle logic defined in Oxygen UI.

The solution ensures that the InputProps property is conditionally applied to avoid breaking any existing components.

Additionally, this PR includes the reversal of changes made in the following PR to align with this fix:

Related Issues

Checklist

  • e2e cypress tests locally verified. (for internal contributers)
  • Manual test round performed and verified.
  • UX/UI review done on the final implementation.
  • Documentation provided. (Add links if there are any)
  • Relevant backend changes deployed and verified
  • Unit tests provided. (Add links if there are any)
  • Integration tests provided. (Add links if there are any)

Security checks

@wso2-jenkins-bot
Copy link
Contributor

🦋 Changeset detected

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Copy link

codecov bot commented Jan 28, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 41.98%. Comparing base (b91585e) to head (d98513e).
Report is 209 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #7439   +/-   ##
=======================================
  Coverage   41.98%   41.98%           
=======================================
  Files          42       42           
  Lines         936      936           
  Branches      214      227   +13     
=======================================
  Hits          393      393           
+ Misses        543      499   -44     
- Partials        0       44   +44     
Flag Coverage Δ
@wso2is/core 41.98% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

see 12 files with indirect coverage changes

Comment on lines +81 to +89
{ ...(endAdornment || readOnly
? {
InputProps: {
...(endAdornment && { endAdornment }),
...(readOnly && { readOnly })
}
}
: {})
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the correct fix would be to update the oxygen ui password field component by moving {...rest} before InputProps[1]. @savindi7 @DonOmalVindula WDYT?

[1] https://github.com/wso2/oxygen-ui/blob/main/packages/react/src/components/TextField/TextField.tsx#L74

Copy link
Contributor

@pavinduLakshan pavinduLakshan Jan 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or we can extract InputProps[1] and check for endAdornment before passing it to MuiTextField in PasswordField component.

[1] https://github.com/wso2/oxygen-ui/blob/main/packages/react/src/components/TextField/TextField.tsx#L59

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tagging @brionmario for further input.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants