Skip to content

Commit 96b163b

Browse files
Rendezdanez
authored andcommitted
fix(tabs): click wrapper container bubbles up to document causing getAttribute() to throw (#221)
Last commit removed the use of `nodeName`, but the event can potentially bubble up all the way to the `DocumentElement` whose interface has no `getAttribute()` method.
1 parent 3af89eb commit 96b163b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/UncontrolledTabs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { isTabList, isTabPanel, isTab } from '../helpers/elementTypes';
99

1010
// Determine if a node from event.target is a Tab element
1111
function isTabNode(node) {
12-
return node.getAttribute('role') === 'tab';
12+
return 'getAttribute' in node && node.getAttribute('role') === 'tab';
1313
}
1414

1515
// Determine if a tab node is disabled

0 commit comments

Comments
 (0)