Skip to content

Commit 6a03faf

Browse files
committed
fix(a11y): assign correct role when collapsible prop is 'icon' or 'header'
1 parent 44a5d48 commit 6a03faf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Panel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,11 @@ const CollapsePanel = React.forwardRef<HTMLDivElement, CollapsePanelProps>((prop
8383
'aria-disabled': disabled,
8484
onKeyDown: handleKeyDown,
8585
style: styles.header,
86+
role: accordion ? 'tab' : 'button',
8687
};
8788

8889
if (!collapsibleHeader && !collapsibleIcon) {
8990
headerProps.onClick = handleItemClick;
90-
headerProps.role = accordion ? 'tab' : 'button';
9191
headerProps.tabIndex = disabled ? -1 : 0;
9292
}
9393

0 commit comments

Comments
 (0)