Skip to content

Commit

Permalink
feat(tabs): verify click tabNode using *[role=tab] (#220)
Browse files Browse the repository at this point in the history
Implementing `react-tabs` with a custom `TabList` & `Tab` components can be currently done by using the corresponding `tabRole` static in custom components. This is neat. However, the check within `isTabNode()` relies on the tagName being an `LI` element, and this has some limitations for cases where the `tabList` markup isn't done using a `ul > li` structure.
  • Loading branch information
Rendez authored and danez committed Jan 9, 2018
1 parent 82e2913 commit 5bd6bfe
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.nodeName === 'LI' && node.getAttribute('role') === 'tab';
return node.getAttribute('role') === 'tab';
}

// Determine if a tab node is disabled
Expand Down

0 comments on commit 5bd6bfe

Please sign in to comment.