Skip to content

Commit 276db69

Browse files
committed
Adding ref for TabList
1 parent ac4863f commit 276db69

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/tabs.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ module.exports = React.createClass({
8585
return React.Children.count(this.props.children.slice(1));
8686
},
8787

88+
getTabList: function () {
89+
return this.refs.tablist;
90+
},
91+
8892
getTab: function (index) {
8993
return this.refs['tabs-' + index];
9094
},
@@ -150,6 +154,7 @@ module.exports = React.createClass({
150154
// Clone TabList and Tab components to have refs
151155
if (count++ === 0) {
152156
result = React.addons.cloneWithProps(child, {
157+
ref: 'tablist',
153158
children: React.Children.map(child.props.children, function (tab) {
154159
var ref = 'tabs-' + index,
155160
id = state.tabIds[index],

0 commit comments

Comments
 (0)