From 5bd6bfe0e409bf45ef7cbb00e442d5333444810c Mon Sep 17 00:00:00 2001 From: Luis Merino Date: Tue, 9 Jan 2018 13:59:54 +0100 Subject: [PATCH] feat(tabs): verify click tabNode using *[role=tab] (#220) 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. --- src/components/UncontrolledTabs.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/UncontrolledTabs.js b/src/components/UncontrolledTabs.js index b14ea105ff..1eac208ed0 100644 --- a/src/components/UncontrolledTabs.js +++ b/src/components/UncontrolledTabs.js @@ -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