Skip to content

Commit 62292af

Browse files
authored
fix: remove duplicate radio role and optimize aria attributes (#318)
1 parent c522d13 commit 62292af

File tree

4 files changed

+18
-89
lines changed

4 files changed

+18
-89
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
},
5454
"devDependencies": {
5555
"@rc-component/father-plugin": "^1.0.1",
56-
"@testing-library/jest-dom": "^5.16.5",
56+
"@testing-library/jest-dom": "^6.9.1",
5757
"@testing-library/react": "^14.2.1",
5858
"@testing-library/user-event": "^14.5.2",
5959
"@types/classnames": "^2.2.9",

src/index.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,7 @@ const InternalSegmentedOption: React.FC<{
131131
onKeyDown={onKeyDown}
132132
onKeyUp={onKeyUp}
133133
/>
134-
<div
135-
className={`${prefixCls}-item-label`}
136-
title={title}
137-
role="radio"
138-
aria-checked={checked}
139-
>
134+
<div className={`${prefixCls}-item-label`} title={title}>
140135
{label}
141136
</div>
142137
</label>
@@ -247,6 +242,7 @@ const Segmented = React.forwardRef<HTMLDivElement, SegmentedProps>(
247242
role="radiogroup"
248243
aria-label="segmented control"
249244
tabIndex={disabled ? undefined : 0}
245+
aria-orientation={vertical ? 'vertical' : 'horizontal'}
250246
{...divProps}
251247
className={classNames(
252248
prefixCls,

0 commit comments

Comments
 (0)