* Determine if a node from event.target is a Tab element for the current Tabs container. * If the clicked element is not a Tab, it returns false. * If it finds another Tabs container between the Tab and `this`, it returns false.
(node)
| 356 | * If it finds another Tabs container between the Tab and `this`, it returns false. |
| 357 | */ |
| 358 | function isTabFromContainer(node) { |
| 359 | // return immediately if the clicked element is not a Tab. |
| 360 | if (!isTabNode(node)) { |
| 361 | return false; |
| 362 | } |
| 363 | |
| 364 | // Check if the first occurrence of a Tabs container is `this` one. |
| 365 | let nodeAncestor = node.parentElement; |
| 366 | do { |
| 367 | if (nodeAncestor === ref.current) return true; |
| 368 | if (nodeAncestor.getAttribute('data-rttabs')) break; |
| 369 | |
| 370 | nodeAncestor = nodeAncestor.parentElement; |
| 371 | } while (nodeAncestor); |
| 372 | |
| 373 | return false; |
| 374 | } |
| 375 | const { |
| 376 | children, // unused |
| 377 | className, |
no test coverage detected
searching dependent graphs…