Skip to content

Commit ffdb5d6

Browse files
fix(WeightedAssessmentSurvey): Update help text tooltip implementation
- Changed the help text display from using the `title` attribute to a `data-title` attribute for better accessibility and consistency. - Updated CSS to reflect the change in tooltip functionality, ensuring help text is displayed correctly on hover.
1 parent adf7dc7 commit ffdb5d6

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

js/src/components/widgets/WeightedAssessmentSurveyWidget.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2544,7 +2544,7 @@ const WeightedAssessmentSurveyWidget: React.FC<WeightedAssessmentSurveyWidgetPro
25442544
className="question-text-inline"
25452545
/>
25462546
{question.helpText && (
2547-
<span className="question-help-icon" title={question.helpText}>
2547+
<span className="question-help-icon" data-title={question.helpText}>
25482548
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
25492549
<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z" fill="currentColor"/>
25502550
</svg>

js/src/css/components/WeightedAssessmentSurvey.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2439,8 +2439,8 @@
24392439
}
24402440

24412441
/* Add tooltip functionality */
2442-
.question-help-icon[title]:hover::after {
2443-
content: attr(title);
2442+
.question-help-icon[data-title]:hover::after {
2443+
content: attr(data-title);
24442444
position: absolute;
24452445
left: 50%;
24462446
transform: translateX(-50%);
@@ -2460,7 +2460,7 @@
24602460
word-break: break-word;
24612461
}
24622462

2463-
.question-help-icon[title]:hover::before {
2463+
.question-help-icon[data-title]:hover::before {
24642464
content: '';
24652465
position: absolute;
24662466
left: 50%;

0 commit comments

Comments
 (0)