-
Notifications
You must be signed in to change notification settings - Fork 2.1k
feat(password-input): allow toggling password visibility when readonly is true #21158
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
base: main
Are you sure you want to change the base?
feat(password-input): allow toggling password visibility when readonly is true #21158
Conversation
✅ Deploy Preview for v11-carbon-web-components ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #21158 +/- ##
==========================================
- Coverage 92.34% 92.34% -0.01%
==========================================
Files 530 530
Lines 40855 40862 +7
Branches 5922 5864 -58
==========================================
+ Hits 37727 37733 +6
- Misses 2976 2978 +2
+ Partials 152 151 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
✅ Deploy Preview for carbon-elements ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for v11-carbon-react ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@maradwan26 Thanks for making this PR. It is looking good but there are just a couple things that need to be changed to match the design spec.
React
Default style
- In readOnly, The view icon should not get a visual color change on hover. It should always be
$icon-primary, on enabled and hover states. - The tooltip should also be using the icon button tooltip height. The alignment of the caret on the tooltip is also off and it should match how WC is doing it. The spacing between the button and the tooltip should be 4px. I have a feeling this is a problem with the icon button component in React. That can be addressed in a separate PR if it needs to be.
Fluid style
- In readOnly, The input text and dots should be
$text-secondaryfor the fluid style. - In readOnly, The view icon should not get a visual color change on hover. It should always be
$icon-primary. This also should be the same in the enabled state. - In the tooltip, I would just say “Hide password” and “Show password” like we do for the Default style for consistency.
- Same tooltip issue as above in the default style, but I think its a problem in the icon button component in React.
WC
Default style
- In readOnly, The view icon should not get a visual color change on hover. It should always be
$icon-primary, on enabled and hover states. - In the tooltip, Keep the
pin "password" lowercase to match React and our content guidelines. - The tooltip should also be using the icon button tooltip height. That can be addressed in a separate PR if it needs to be.
Like you mentioned earlier, we can review Fluid in WC when it is complete.
heloiselui
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!


Closes #21116
Updates the PasswordInput
readOnlystate to allow for the user to toggle the password visibility in both React and Web ComponentsChangelog
New
Changed
disabledis true and excludereadOnlyTesting / Reviewing
readOnlyis trueNote
The implementation for the WC FluidPasswordInput is still in progress, however, similarly to the React version, the
readOnlystate handling is covered by the base PasswordInput. I pulled down that branch and tested the changes there, and it functionally works, so I believe once that PR is merged it should be goodPR Checklist
As the author of this PR, before marking ready for review, confirm you:
[ ] Updated documentation and storybook examples