MCPcopy
hub / github.com/adobe/react-spectrum / getSelectedTab

Method getSelectedTab

packages/@react-aria/test-utils/src/tabs.ts:193–195  ·  view source on GitHub ↗

* Returns the currently selected tab in the tablist if any.

()

Source from the content-addressed store, hash-verified

191 * Returns the currently selected tab in the tablist if any.
192 */
193 getSelectedTab(): HTMLElement | null {
194 return this.getTabs().find(tab => tab.getAttribute('aria-selected') === 'true') || null;
195 }
196
197 /**
198 * Returns the currently active tabpanel if any.

Callers 5

keyboardNavigateToTabMethod · 0.95
getActiveTabpanelMethod · 0.95
Tabs.test.jsFile · 0.80
Tabs.test.jsFile · 0.80

Calls 1

getTabsMethod · 0.95

Tested by

no test coverage detected