MCPcopy
hub / github.com/reactjs/react-tabs / handleClick

Function handleClick

src/components/UncontrolledTabs.jsx:335–351  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

333 }
334
335 function handleClick(e) {
336 let node = e.target;
337 do {
338 if (isTabFromContainer(node)) {
339 if (isTabDisabled(node)) {
340 return;
341 }
342
343 const index = [].slice
344 .call(node.parentNode.children)
345 .filter(isTabNode)
346 .indexOf(node);
347 setSelected(index, e);
348 return;
349 }
350 } while ((node = node.parentNode) != null);
351 }
352
353 /**
354 * Determine if a node from event.target is a Tab element for the current Tabs container.

Callers 1

handleKeyDownFunction · 0.85

Calls 3

isTabFromContainerFunction · 0.85
isTabDisabledFunction · 0.85
setSelectedFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…