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

[Tooltip] when active prop is undefined, tooltip still appears #12597

Closed
pt8o opened this issue Sep 3, 2024 · 1 comment
Closed

[Tooltip] when active prop is undefined, tooltip still appears #12597

pt8o opened this issue Sep 3, 2024 · 1 comment
Labels
Bug Something is broken and not working as intended in the system. untriaged

Comments

@pt8o
Copy link
Contributor

pt8o commented Sep 3, 2024

Summary

When you pass a const whose value is undefined into the active prop of a <Tooltip>, the tooltip will appear even though it shouldn't.

Expected behavior

undefined is falsy so passing undefined to active should lead to the tooltip not showing.

Actual behavior

Image

Tooltip shows up a const with value undefined is passed into its active prop.

Steps to reproduce

Link to sandbox

  1. Hover on the text to show the tooltip

Are you using React components?

Yes

Polaris version number

13.9.0

Browser

Chrome

Device

MacOS

@pt8o pt8o added Bug Something is broken and not working as intended in the system. untriaged labels Sep 3, 2024
@pt8o
Copy link
Contributor Author

pt8o commented Sep 3, 2024

Closing this because I suspect it's intended 🤔

Seems like undefined means defer to Tooltip's internal state i.e. show the tooltip on hover, hide on blur. Whereas passing in true/false is forcing the Tooltip's state from outside. I've fixed the place where I spotted this on web and will close this issue.

@pt8o pt8o closed this as completed Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken and not working as intended in the system. untriaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant