Skip to content

fix(PasswordInput): tooltip issue in show password label or hide password label #17103

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

Conversation

preetibansalui
Copy link
Contributor

Closes #16924

fixed broken tooltip if label is blank and added a console warning if label is blank.

New

added a console warning if showPasswordLabel or hidePasswordLabel is blank.

@preetibansalui preetibansalui requested a review from a team as a code owner August 5, 2024 07:13
Copy link

netlify bot commented Aug 5, 2024

Deploy Preview for v11-carbon-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit a86f7c5
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-react/deploys/66b07b9dc69a1900086b2345
😎 Deploy Preview https://deploy-preview-17103--v11-carbon-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Aug 5, 2024

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit a86f7c5
🔍 Latest deploy log https://app.netlify.com/sites/carbon-elements/deploys/66b07b9d04a36a0008dd2160
😎 Deploy Preview https://deploy-preview-17103--carbon-elements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@2nikhiltom
Copy link
Contributor

Hey @preetibansalui

Just a question : Should the tooltip be rendered on UI if the string is empty ? I see warning is console but the tooltip renders with no content.

Im curious of useCase where consumers would want to pass an empty string for hidePasswordLabel/ ShowPasswordLabel.
and Incase they do want an empty string, should we completely remove the tooltip itself ?

image

@Kritvi-bhatia17 Kritvi-bhatia17 self-requested a review August 5, 2024 07:38
Copy link
Contributor

@Kritvi-bhatia17 Kritvi-bhatia17 left a comment

Choose a reason for hiding this comment

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

Looks good to me from design perspective! 🎉

@preetibansalui
Copy link
Contributor Author

Hey @preetibansalui

Just a question : Should the tooltip be rendered on UI if the string is empty ? I see warning is console but the tooltip renders with no content.

Im curious of useCase where consumers would want to pass an empty string for hidePasswordLabel/ ShowPasswordLabel. and Incase they do want an empty string, should we completely remove the tooltip itself ?

image

Hi @2nikhiltom, you've raised a valid point.

  1. While there's no purpose in providing an empty string for the tooltip, users are still able to enter any value in the label field. Therefore, we need to handle for the case of a blank string as well.
  2. At this moment, we cannot make this field mandatory, as this would be a breaking change. However, we plan to designate it as a required field in version 12.

@preetibansalui
Copy link
Contributor Author

Hey @preetibansalui
Just a question : Should the tooltip be rendered on UI if the string is empty ? I see warning is console but the tooltip renders with no content.
Im curious of useCase where consumers would want to pass an empty string for hidePasswordLabel/ ShowPasswordLabel. and Incase they do want an empty string, should we completely remove the tooltip itself ?
image

Hi @2nikhiltom, you've raised a valid point.

  1. While there's no purpose in providing an empty string for the tooltip, users are still able to enter any value in the label field. Therefore, we need to handle for the case of a blank string as well.
  2. At this moment, we cannot make this field mandatory, as this would be a breaking change. However, we plan to designate it as a required field in version 12.

Also, as per the a11y point of view, all clickable icons will have a tooltip. If no tooltip text is provided, a blank tooltip will be displayed.

@2nikhiltom
Copy link
Contributor

It makes sense from a11y point of view, thanks Preeti

Copy link
Member

@emyarod emyarod left a comment

Choose a reason for hiding this comment

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

looks good to me!

@emyarod emyarod changed the title 16924 tooltip issue in show password label or hide password label fix(PasswordInput): tooltip issue in show password label or hide password label Aug 5, 2024
@riddhybansal riddhybansal added this pull request to the merge queue Aug 5, 2024
Merged via the queue into carbon-design-system:main with commit aa7b805 Aug 5, 2024
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Password-input] Tooltip issue on hide password icon hover
5 participants