Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "office-ui-fabric-react",
"comment": "Add aria-describedby to tooltiphost component",
"type": "patch"
}
],
"email": "ottost@microsoft.com"
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { TooltipDelay } from './Tooltip.Props';

import * as stylesImport from './TooltipHost.scss';
const styles: any = stylesImport;
import { getId } from '@uifabric/utilities';

export interface ITooltipHostState {
isTooltipVisible?: boolean;
Expand All @@ -40,9 +41,9 @@ export class TooltipHost extends BaseComponent<ITooltipHostProps, ITooltipHostSt

// Render
public render() {
const { calloutProps, content, children, directionalHint, delay } = this.props;
const { calloutProps, content, children, directionalHint, delay, id } = this.props;
const { isTooltipVisible } = this.state;

const tooltipId = id || getId('tooltip');
return (
<div
className={ css('ms-TooltipHost', styles.host) }
Expand All @@ -51,10 +52,12 @@ export class TooltipHost extends BaseComponent<ITooltipHostProps, ITooltipHostSt
{ ...{ onBlurCapture: this._onTooltipMouseLeave } }
onMouseEnter={ this._onTooltipMouseEnter }
onMouseLeave={ this._onTooltipMouseLeave }
aria-describedby={ isTooltipVisible ? tooltipId : undefined }
>
{ children }
{ isTooltipVisible && (
<Tooltip
id={ tooltipId }
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesn't work

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ostreifel the tooltip is lying to us :) these props are never applied, unfortunately

Copy link
Copy Markdown
Contributor Author

@ostreifel ostreifel Apr 27, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delay={ delay }
content={ content }
targetElement={ this._getTargetElement() }
Expand Down