From d403776d8bb79e64f719d4d3ba8fd5db22d18c70 Mon Sep 17 00:00:00 2001 From: Jony J <1844749591@qq.com> Date: Mon, 28 Oct 2024 15:40:21 +0800 Subject: [PATCH] fix(a11y): assign correct role when collapsible prop is 'icon' or 'header' (#353) --- src/Panel.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Panel.tsx b/src/Panel.tsx index 5fbca54..379202b 100644 --- a/src/Panel.tsx +++ b/src/Panel.tsx @@ -83,11 +83,11 @@ const CollapsePanel = React.forwardRef((prop 'aria-disabled': disabled, onKeyDown: handleKeyDown, style: styles.header, + role: accordion ? 'tab' : 'button', }; if (!collapsibleHeader && !collapsibleIcon) { headerProps.onClick = handleItemClick; - headerProps.role = accordion ? 'tab' : 'button'; headerProps.tabIndex = disabled ? -1 : 0; }