From 9387e53e616d8375c1b5f4e2cc9c124fd7402c0a Mon Sep 17 00:00:00 2001 From: afc163 Date: Mon, 28 Oct 2024 16:24:17 +0800 Subject: [PATCH] feat: improve a11y behavior --- assets/index.less | 4 ++-- src/Panel.tsx | 3 +-- tests/__snapshots__/index.spec.tsx.snap | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/assets/index.less b/assets/index.less index 69f97a8..097e655 100644 --- a/assets/index.less +++ b/assets/index.less @@ -59,7 +59,7 @@ margin: 0 16px 0 auto; } } - .@{prefixCls}-header-collapsible-only { + .@{prefixCls}-collapsible-header { cursor: default; .@{prefixCls}-header-text { cursor: pointer; @@ -68,7 +68,7 @@ cursor: pointer; } } - .@{prefixCls}-icon-collapsible-only { + .@{prefixCls}-collapsible-icon { cursor: default; .@{prefixCls}-expand-icon { cursor: pointer; diff --git a/src/Panel.tsx b/src/Panel.tsx index b2f738a..4f21792 100644 --- a/src/Panel.tsx +++ b/src/Panel.tsx @@ -72,8 +72,7 @@ const CollapsePanel = React.forwardRef((prop headerClass, `${prefixCls}-header`, { - [`${prefixCls}-header-collapsible-only`]: collapsible === 'header', - [`${prefixCls}-icon-collapsible-only`]: collapsible === 'icon', + [`${prefixCls}-collapsible-${collapsible}`]: !!collapsible, }, customizeClassNames.header, ); diff --git a/tests/__snapshots__/index.spec.tsx.snap b/tests/__snapshots__/index.spec.tsx.snap index ddbe32a..34c8c4a 100644 --- a/tests/__snapshots__/index.spec.tsx.snap +++ b/tests/__snapshots__/index.spec.tsx.snap @@ -10,7 +10,7 @@ exports[`collapse props items should work with nested 1`] = `