You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When adding toggletips to form fields through the labelText prop, styling is slightly different than for form fields without a toggletip.
I'm not sure if labelText is the recommended way of adding a tooltip to a form field. I could not really find guidance for this. If it is the recommended way, it should work (look good) out of the box, I feel like.
I was made aware that technically the <FormLabel> is not required to get the correct text styling. However, omitting it, leads to the icon being displayed right next to the label and not with some space in between as in the screenshot.
silverclaru
changed the title
[Bug]: Adding toggletip to form fields causes label and field mis-alignment
[Bug]: Adding toggletip to form fields causes label and field misalignment
Nov 28, 2024
Package
@carbon/react
Browser
Chrome, Firefox
Package version
1.66.0 (but reproducible on 1.71.0 as well)
React version
18.2.0
Description
When adding toggletips to form fields through the
labelText
prop, styling is slightly different than for form fields without a toggletip.I'm not sure if
labelText
is the recommended way of adding a tooltip to a form field. I could not really find guidance for this. If it is the recommended way, it should work (look good) out of the box, I feel like.Reproduction/example
https://stackblitz.com/edit/github-bimuxr?file=src%2FApp.jsx
Steps to reproduce
The screenshot above was created through the following source code.
I was made aware that technically the
<FormLabel>
is not required to get the correct text styling. However, omitting it, leads to the icon being displayed right next to the label and not with some space in between as in the screenshot.I also did try something like this:
But that still leads to a similar result although the misalignment is more subtle (on my screen 2px vs 4 px).
Suggested Severity
None
Application/PAL
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: