Replies: 2 comments 1 reply
-
Most screen readers only output the group label (legend) when entering the group (fieldset), but not for each element inside the group, as this would be superfluous. In this respect, I don't see a problem. It could be annoying that the tooltip is already output in the closed state. For the button role, the expectation would be that the button only has a short label (e.g. "Info" or "Help") and that the tooltip is only output by the screen reader after activation |
Beta Was this translation helpful? Give feedback.
-
The ARIA example assumes that the tooltip is displayed automatically and not after activating a button. Imagine you have an input field with a tooltip. The tooltip is displayed when the keyboard focus is placed in the input field or when you move the mouse over the input field. It is then important that the tooltip is output via aria-describedby. In your case, you have a button which, when activated with the mouse, displays the tooltip. My expectation here would be that the tooltip is only output when it is visible. In addition, your button has no labeling, which is a violation of WCAG SC 4.1.2. That's why I suggest labeling the button with "Info" or "Help". If the tooltip is displayed automatically, you don't actually need the button role - which one then? I have no idea. In any case, it is important that you also fulfill WCAG SC 1.4.13, which is currently not the case for you. Please note that there is a reason why there is no ARIA pattern for tooltips yet, because the correct implementation is considered complicated and there is no consensus on the best solution. See: https://whatsock.com/Templates/Tooltips/Internal/ and w3c/aria-practices#128 + w3c/aria-practices#127 |
Beta Was this translation helpful? Give feedback.
-
I want to put a tooltip beside our fieldset legend to better explain the form inputs, but I noticed that my screenreader will read out the legend text when the first focusable element (i.e. the tooltip trigger button) is focused.
This means that it won't read out the legend text when the first input field is focused (only seems to announce the legend text when entering the fieldset).
Is this a problem? Could the markup be better to help explain the fieldset?
Here's a screenshot of an example screenreader text:
Here's a codepen demo:
https://codepen.io/bozdoz/pen/ZEwXbXE?editors=1000
And some of the markup:
Beta Was this translation helpful? Give feedback.
All reactions