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
10 changes: 10 additions & 0 deletions common/changes/add-tooltip-className_2017-05-02-10-28.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "office-ui-fabric-react",
"comment": "TooltipHost: Add host className",
"type": "patch"
}
],
"email": "hross@hross.net"
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,9 @@ export interface ITooltipHostProps extends React.HTMLProps<HTMLDivElement | Tool
* It also uses the parent as target element for the tooltip.
*/
overflowMode?: TooltipOverflowMode;

/**
* Optional class name to apply to tooltip host.
*/
hostClassName?: string;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

shouldn't this just be className

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.

@dzearing className is passed through to the tooltip

}
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ export class TooltipHost extends BaseComponent<ITooltipHostProps, ITooltipHostSt

// Render
public render() {
const { calloutProps, content, children, directionalHint, delay, id } = this.props;
const { calloutProps, content, children, directionalHint, delay, id, hostClassName } = this.props;
const { isTooltipVisible } = this.state;
const tooltipId = id || getId('tooltip');
return (
<div
className={ css('ms-TooltipHost', styles.host) }
className={ css('ms-TooltipHost', styles.host, hostClassName) }
ref={ this._resolveRef('_tooltipHost') }
{ ...{ onFocusCapture: this._onTooltipMouseEnter } }
{ ...{ onBlurCapture: this._onTooltipMouseLeave } }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import * as React from 'react';
/* tslint:enable:no-unused-variable */
import { BaseComponent, css } from 'office-ui-fabric-react/lib/Utilities';
import { Button } from 'office-ui-fabric-react/lib/Button';
import { DefaultButton } from 'office-ui-fabric-react/lib/Button';
import {
TooltipHost,
TooltipOverflowMode
Expand All @@ -20,7 +20,7 @@ export class TooltipOverflowExample extends BaseComponent<any, any> {
public render() {
return (
<div>
<Button onClick={ () => this.setState({ overflow: !this.state.overflow }) }>Toggle showing overflow</Button>
<DefaultButton onClick={ () => this.setState({ overflow: !this.state.overflow }) }>Toggle showing overflow</DefaultButton>

<div style={ {
marginTop: '40px'
Expand Down