Accessibility in EJ2 TypeScript Tooltip component
24 Jan 20244 minutes to read
The accessibility compliance for the Tooltip component is outlined below.
|WCAG 2.2 Support
|Section 508 Support
|Screen Reader Support
|Mobile Device Support
|Keyboard Navigation Support
|Accessibility Checker Validation
|Axe-core Accessibility Validation
The Tooltip component followed the WAI-ARIA patterns to meet the accessibility. The following ARIA attributes are used in the Tooltip component.
|The element that serves as the container for the tooltip has the ARIA role of
|This attribute is added to the target element on which the Tooltip gets opened, when focusing or hovering over it. It usually holds the randomly generated
Id value of the Tooltip element.
In case, the target element already holds an
aria-describedby attribute with
Id value of some other component, then the Tooltip Id value can be additionally appended to the existing
aria-describedby attribute separated by a space as shown in the example below.
aria-describedby = “my-text my-tooltip”
my-text is the Id of some other component.
my-tooltip is the id of Tooltip component.
When the Tooltip is closed, the
aria-describedby attribute is removed from the target.
|This attribute is assigned to the Tooltip element whose default value is true.
true, it denotes that the Tooltip element is in a hidden or a closed state. When the Tooltip appears on the screen, it’s value changes to
The Tooltip component followed the keyboard interaction guideline, making it easy for people who use assistive technologies (AT) and those who completely rely on keyboard navigation. The following keyboard shortcuts are supported by the Tooltip component.
|Closes or dismisses the Tooltip.
|A form control receiving focus (say through tab key), opens the Tooltip, and on focus out closes it.
- When the Tooltip is being displayed on the target element, focus continues to stay on it.
- If the Tooltip opens on mouse entering into the target element space, then it should be dismissed only when the mouse leaves that target.
- If the Tooltip opens on the target element that receives focus, then it should be closed only when the focus moves out of that target element.
Likewise, if the Tooltip opens on a click, then it should be closed only on another click action.
The accessibility compliance of the Tooltip component is shown in the following sample. Open the sample in a new window to evaluate the accessibility of the Tooltip component with accessibility tools.