Allow disabling animated bottom border on tabs

old
Jesse Smith 2016-03-16 14:56:20 -07:00
parent 752f2cb7fd
commit a2543d4a11
2 changed files with 9 additions and 5 deletions

View File

@ -7,6 +7,7 @@ class Tabs extends React.Component {
static propTypes = {
children: React.PropTypes.node,
className: React.PropTypes.string,
disableAnimatedBottomBorder: React.PropTypes.bool,
index: React.PropTypes.number,
onChange: React.PropTypes.func
};
@ -20,11 +21,13 @@ class Tabs extends React.Component {
};
componentDidMount () {
this.updatePointer(this.props.index);
!this.props.disableAnimatedBottomBorder &&
this.updatePointer(this.props.index);
}
componentWillReceiveProps (nextProps) {
this.updatePointer(nextProps.index);
!this.props.disableAnimatedBottomBorder &&
this.updatePointer(nextProps.index);
}
handleHeaderClick = (idx) => {

View File

@ -39,9 +39,10 @@ This component acts as the wrapper and the main controller of the content that i
| Name | Type | Default | Description|
|:-----|:-----|:-----|:-----|
| `className` | `String` | `''` | Additional class name to provide custom styling.|
| `index` | `Number` | `0` | Current <Tab> |
| `onChange` | `Function` | | Callback function that is fired when the tab changes.
| `className` | `String` | `''` | Additional class name to provide custom styling.|
| `index` | `Number` | `0` | Current <Tab> |
| `onChange` | `Function` | | Callback function that is fired when the tab changes.|
| `disableAnimatedBottomBorder` | `Boolean` | `false` | Disable the animation below the active tab
## Tab