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]: tooltipAlignment is being passed to DOM element incorrectly for Button component #16140

Closed
2 tasks done
a88zach opened this issue Apr 5, 2024 · 1 comment · Fixed by #16169
Closed
2 tasks done
Assignees

Comments

@a88zach
Copy link

a88zach commented Apr 5, 2024

Package

@carbon/react

Browser

Chrome

Package version

1.54.0

React version

18.2.0

Description

When a Button component contains the tooltipAlignment property, the property is being passed incorrectly to the button DOM element causing a warning in the console. The use case here is that I want to display an icon only on small resolutions, but the full button with icon on larger screens

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

Reproduction/example

https://stackblitz.com/edit/github-ptctcq?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

@tay1orjones tay1orjones self-assigned this Apr 10, 2024
@tay1orjones tay1orjones added the severity: 3 https://ibm.biz/carbon-severity label Apr 10, 2024
@tay1orjones
Copy link
Member

Thanks for reporting this. A workaround for now would be to not set tooltipAlignment when hasIconOnly=false, but I do think we can guard against this inside the component as well.

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

Successfully merging a pull request may close this issue.

2 participants