Skip to content

Commit f7406c3

Browse files
committed
tabs: allow passed props to override hidden prop (#438)
1 parent bba6732 commit f7406c3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/tabs/src/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -385,10 +385,10 @@ export const TabList = forwardRefWithAs<TabListProps, "div">(function TabList(
385385

386386
return (
387387
<Comp
388+
role="tablist"
388389
{...props}
389390
data-reach-tab-list=""
390391
ref={ref}
391-
role="tablist"
392392
onKeyDown={wrapEvent(onKeyDown, handleKeyDown)}
393393
>
394394
{Children.map(children, (child, index) => {
@@ -474,6 +474,7 @@ export const Tab = forwardRefWithAs<
474474

475475
return (
476476
<Comp
477+
role="tab"
477478
{...props}
478479
ref={ref}
479480
data-reach-tab=""
@@ -485,7 +486,6 @@ export const Tab = forwardRefWithAs<
485486
disabled={disabled}
486487
id={makeId(tabsId, "tab", index)}
487488
onClick={onSelect}
488-
role="tab"
489489
tabIndex={isSelected ? 0 : -1}
490490
>
491491
{children}
@@ -578,13 +578,13 @@ export const TabPanel = forwardRefWithAs<TabPanelProps, "div">(
578578

579579
return (
580580
<Comp
581+
hidden={!isSelected}
582+
role="tabpanel"
581583
{...props}
582584
ref={ref}
583585
data-reach-tab-panel=""
584586
aria-labelledby={makeId(tabsId, "tab", index)}
585-
hidden={!isSelected}
586587
id={id}
587-
role="tabpanel"
588588
tabIndex={-1}
589589
>
590590
{children}

0 commit comments

Comments
 (0)