Skip to content

Commit

Permalink
fix(tabs): click wrapper container bubbles up to document causing get…
Browse files Browse the repository at this point in the history
…Attribute() 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.
  • Loading branch information
Rendez authored and danez committed Jan 9, 2018
1 parent 3af89eb commit 96b163b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/UncontrolledTabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { isTabList, isTabPanel, isTab } from '../helpers/elementTypes';

// Determine if a node from event.target is a Tab element
function isTabNode(node) {
return node.getAttribute('role') === 'tab';
return 'getAttribute' in node && node.getAttribute('role') === 'tab';
}

// Determine if a tab node is disabled
Expand Down

0 comments on commit 96b163b

Please sign in to comment.