react-apiembed
Advanced tools
Comparing version 0.1.5 to 0.1.6
@@ -1017,2 +1017,6 @@ (function (global, factory) { | ||
_this.setTabRef = function (element, index) { | ||
_this.tabRefs[index] = element; | ||
}; | ||
_this.clickHandler = _this.clickHandler.bind(_this); | ||
@@ -1024,5 +1028,3 @@ _this.keypressHandler = _this.keypressHandler.bind(_this); | ||
}; | ||
_this.tabRefs = Array.from({ length: _this.props.snippets.length }, function () { | ||
return React.createRef(); | ||
}); | ||
_this.tabRefs = []; | ||
return _this; | ||
@@ -1039,3 +1041,3 @@ } | ||
if (prevState.activeTab !== this.state.activeTab) { | ||
this.tabRefs[this.state.activeTab].current.focus(); | ||
this.tabRefs[this.state.activeTab].focus(); | ||
} | ||
@@ -1116,3 +1118,3 @@ } | ||
ref: function ref(el) { | ||
return _this2.tabRefs[index].current = el; | ||
return _this2.setTabRef(el, index); | ||
}, | ||
@@ -1119,0 +1121,0 @@ key: index |
{ | ||
"name": "react-apiembed", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"description": "React api embed component.", | ||
@@ -5,0 +5,0 @@ "files": [ |
1004
65171