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

[Bug]: tooltipPosition is being passed to DOM element incorrectly for Button component #16501

Closed
2 tasks done
AlyonaSidarenka opened this issue May 18, 2024 · 2 comments
Closed
2 tasks done

Comments

@AlyonaSidarenka
Copy link

Package

@carbon/react

Browser

Chrome

Package version

1.54.0

React version

18.2.0

Description

When a Button component contains the tooltipPosition property, the property is being passed incorrectly to the button DOM element causing a warning in the console.

Warning: React does not recognize the tooltipPositionprop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercasetooltipposition instead. If you accidentally passed it from a parent component, remove it from the DOM element.

Reproduction/example

https://stackblitz.com/edit/github-ptctcq-gmqqna?file=src%2FApp.jsx%3AL8-L8&file=src%2FApp.jsx

Steps to reproduce

Load the Stackblitz and open the console to see the warning generated

Suggested Severity

Severity 2 = User cannot complete task, and/or no workaround within the user experience of a given component.

Application/PAL

No response

Code of Conduct

@2nikhiltom
Copy link
Contributor

2nikhiltom commented May 20, 2024

Hey @AlyonaSidarenka

I reviewed the stackblitz example you have shared.

Any specific reason why hasIconOnly prop is set to false in your example ? i.e hasIconOnly={false}
this is causing the reported issue

The tooltipAlignment prop: Specify the alignment of the tooltip to the icon-only button only.

Check this stackblitz_Example

@AlyonaSidarenka
Copy link
Author

Thanks @2nikhiltom for the quick reply, I've updated the example to not use hasIconOnly prop, but still see the error in the console.
But according to the docs, tooltipAlignment and tooltipPosition should not be used in that case. So my "fix" must be to remove both props from that button.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: ✅ Done
Development

No branches or pull requests

2 participants