We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 05ab1e9 commit 58caf6aCopy full SHA for 58caf6a
src/components/UncontrolledTabs.js
@@ -207,15 +207,12 @@ const UncontrolledTabs = (props) => {
207
determineCanUseActiveElement(environment);
208
}
209
210
- if (canUseActiveElement) {
+ const env =
211
+ environment || (typeof window !== 'undefined' ? window : undefined);
212
+ if (canUseActiveElement && env) {
213
wasTabFocused = React.Children.toArray(child.props.children)
214
.filter(isTab)
- .some((tab, i) => {
- const env =
215
- environment ||
216
- (typeof window !== 'undefined' ? window : undefined);
217
- return env && env.document.activeElement === getTab(i);
218
- });
+ .some((tab, i) => env.document.activeElement === getTab(i));
219
220
221
result = cloneElement(child, {
0 commit comments