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.

Webform element tooltip not visible for checkboxes

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).

Webform element tooltip not visible for checkboxes

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

Comments

iSampo created an issue. See original summary.

isampo’s picture

Here's a patch for updating the selectors, which should work for newer and older style fieldset templates.

isampo’s picture

cilefen’s picture

Can you please post the YAML of an example form?

isampo’s picture

StatusFileSize
new5.92 KB

Here's the YAML export.

isampo’s picture

StatusFileSize
new17.14 KB

Also it looks like that the single checkboxes inside checkbox groups get the empty tooltip as well, even though single options only have "Description" and "Helptext" values available for the "Options description display" select.

Single checkbox element empty tooltip

jrockowitz’s picture

Status: Active » Needs review
jrockowitz’s picture

StatusFileSize
new911 bytes

The attached patch adds the new class names and handles empty (checkbox) descriptions.

rajneeshb’s picture

Tested patch #8 this patch fixes the issues reported at #6. Its working fine.

jrockowitz’s picture

Status: Needs review » Reviewed & tested by the community

liam morland’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.