fluentui
fluentui copied to clipboard
TooltipHost does not set role=tooltip
Bug Report
- Package version(s):
- Browser and OS versions: Edge Windows 10
Priorities and help requested (not applicable if asking question):
Are you willing to submit a PR to fix? Yes
Requested priority: Low
Products/sites affected: TFS
Describe the issue:
I had an accessibility issue reported to me regarding TooltipHost. When using Narrator + IE combo and navigating to a TooltipHost the tooltip is not read aloud and Narrator says "Group". I was able to work around this by:
- setting an
Idfor theTooltipHost - setting the
roleof the child element totooltip - setting the
aria-describedbyof the child element to tooltip
<TooltipHost
id={this._squashMergeCheckboxTooltipId}
content={this.state.squashPolicySetting.reason}
directionalHint={DirectionalHint.bottomCenter}
hostClassName="vc-dialog-info-icon">
<span
tabIndex={0}
role={"tooltip"}
aria-describedby={this._squashMergeCheckboxTooltipId}
className="bowtie-icon bowtie-status-info-outline" />
</TooltipHost>
Actual behavior:
Narrator says "Group"
Expected behavior:
Narrator should say "Tooltip" and then after a pause say the contents of the tooltip.
If applicable, please provide a codepen repro:
I was mistaken. The role is set. For this particular issue I really just needed to set the role of the span to "note" and add an aria-label.