-
Notifications
You must be signed in to change notification settings - Fork 85
(fix) Make the whole label as tooltip trigger #475
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
base: main
Are you sure you want to change the base?
Conversation
Size Change: -266 kB (-16.02%) 👏 Total Size: 1.39 MB
ℹ️ View Unchanged
|
cbf6db6
to
071c102
Compare
1538c46
to
887fd00
Compare
887fd00
to
46a73c6
Compare
const Tooltip: React.FC<{ field: FormField; children: React.ReactNode }> = ({ field, children }) => { | ||
const { t } = useTranslation(); | ||
return ( | ||
<CarbonTooltip align="top-left" label={t(field.questionInfo)} defaultOpen> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think defaultOpen
should not be enabled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought I removed this, apologies.
hasTooltip: boolean; | ||
} | ||
|
||
const FieldLabelContent: React.FC<FieldLabelContentProps> = ({ field, customLabel, hasTooltip }) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vasharma05 Splitting these components feels overkill. Here is a simplified version: https://gist.github.com/samuelmale/daef56444bc7e8ea79c044dc842dec37
Requirements
Summary
Currently, the
i
icon is shown on the right hand of the label which is then used to trigger the tooltip. Now the tooltip rendered was getting cropped by the form's wrapper.Now the whole label is made the tooltip trigger, along with displaying a
i
icon on the right side of the label.Screenshots
Before
After
Related Issue
Other
Slack thread: https://openmrs.slack.com/archives/C04QZ5DDVMG/p1743764918799569