diff --git a/common/changes/office-ui-fabric-react/pivotOverrideStyles_2018-04-03-18-42.json b/common/changes/office-ui-fabric-react/pivotOverrideStyles_2018-04-03-18-42.json new file mode 100644 index 0000000000000..86ba4ab22e1e4 --- /dev/null +++ b/common/changes/office-ui-fabric-react/pivotOverrideStyles_2018-04-03-18-42.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "packageName": "office-ui-fabric-react", + "comment": "Pivot: include className in props to override styles", + "type": "minor" + } + ], + "packageName": "office-ui-fabric-react", + "email": "naethell@microsoft.com" +} diff --git a/packages/office-ui-fabric-react/src/components/Pivot/Pivot.base.tsx b/packages/office-ui-fabric-react/src/components/Pivot/Pivot.base.tsx index 79d57cb0c68e5..d7306274d7a0b 100644 --- a/packages/office-ui-fabric-react/src/components/Pivot/Pivot.base.tsx +++ b/packages/office-ui-fabric-react/src/components/Pivot/Pivot.base.tsx @@ -4,6 +4,8 @@ import { KeyCodes, css, getId, + getNativeProps, + divProperties, createRef } from '../../Utilities'; import { CommandButton } from '../../Button'; @@ -101,8 +103,10 @@ export class PivotBase extends BaseComponent { } public render(): JSX.Element { + const divProps = getNativeProps(this.props, divProperties); + return ( -
+
{ this._renderPivotLinks() } { this._renderPivotItem() }
diff --git a/packages/office-ui-fabric-react/src/components/Pivot/Pivot.test.tsx b/packages/office-ui-fabric-react/src/components/Pivot/Pivot.test.tsx index d205a76ad6fab..fc38cbe26ac89 100644 --- a/packages/office-ui-fabric-react/src/components/Pivot/Pivot.test.tsx +++ b/packages/office-ui-fabric-react/src/components/Pivot/Pivot.test.tsx @@ -14,4 +14,14 @@ describe('Pivot', () => { const tree = component.toJSON(); expect(tree).toMatchSnapshot(); }); + + it('renders Pivot correctly with custom className', () => { + const component = renderer.create( + + + + ); + const tree = component.toJSON(); + expect(tree).toMatchSnapshot(); + }); }); \ No newline at end of file diff --git a/packages/office-ui-fabric-react/src/components/Pivot/__snapshots__/Pivot.test.tsx.snap b/packages/office-ui-fabric-react/src/components/Pivot/__snapshots__/Pivot.test.tsx.snap index b0217b47b1817..38aff5b733422 100644 --- a/packages/office-ui-fabric-react/src/components/Pivot/__snapshots__/Pivot.test.tsx.snap +++ b/packages/office-ui-fabric-react/src/components/Pivot/__snapshots__/Pivot.test.tsx.snap @@ -240,3 +240,248 @@ exports[`Pivot renders Pivot correctly 1`] = `
`; + +exports[`Pivot renders Pivot correctly with custom className 1`] = ` +
+
+
    + + +
+
+
+
+
+
+`;