Tooltip element not being displayed correctly on elements inside fieldset

Created on 6 April 2023, over 1 year ago
Updated 4 October 2023, about 1 year ago

Problem/Motivation

There's an issue with the tooltip display of descriptions, when elements are inside fieldsets. This applies at least to the various different checkboxes and radios elements. On these elements the tooltip is appearing empty.

This is happening because webform.tooltip.js is trying to retrieve the description value from '> .fieldset-wrapper > .description > .webform-element-description.visually-hidden', and the actual markup places the visually-hidden description inside of a fieldset suffix (see screenshot).

Core version: 9.5.7
Webform version: 6.1.4 (and 6.2.0-beta5)
Theme: Olivero (and others)

Notes

1. Depending on a theme, the fieldset suffix has a different selector in fieldset.html.twig. For newer themes like Claro and Olivero the suffix class is .fieldset__wrapper > .fieldset__suffix, but for most themes, the class is .fieldset-wrapper > .field-suffix
2. This one is likely its own issue completely: The tooltip descriptions for other elements is passed through webform-html-editor-markup.html.twig template but for these elements that doesn't happen for some reason. The current checkboxes/radios markup is formatted through WYSIWYG, when compared to the properly working ones that are stripped from tags (for a good reason for tooltips).

Proposed resolution

Change the tooltip description selector to one that can be found on the page.

Remaining tasks

None

User interface changes

None

API changes

None

Data model changes

None

🐛 Bug report
Status

Fixed

Version

6.2

Component

Code

Created by

🇫🇮Finland iSampo

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024