From 80431dca6e06d5f3b1cc3e6e91f476698dba0fa2 Mon Sep 17 00:00:00 2001 From: aojunhao <1844749591@qq.com> Date: Fri, 24 Jan 2025 17:35:55 +0800 Subject: [PATCH 1/2] fix: correct role for a11y --- src/Rate.tsx | 1 - src/Star.tsx | 2 +- tests/__snapshots__/simple.spec.js.snap | 7 ------- 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/src/Rate.tsx b/src/Rate.tsx index b3285b9..46602ba 100644 --- a/src/Rate.tsx +++ b/src/Rate.tsx @@ -238,7 +238,6 @@ function Rate(props: RateProps, ref: React.Ref) { onBlur={disabled ? null : onInternalBlur} onKeyDown={disabled ? null : onInternalKeyDown} ref={rateRef} - role="radiogroup" {...pickAttrs(restProps, { aria: true, data: true, attr: true })} > {starNodes} diff --git a/src/Star.tsx b/src/Star.tsx index 7243069..7b54f4d 100644 --- a/src/Star.tsx +++ b/src/Star.tsx @@ -79,10 +79,10 @@ function Star(props: StarProps, ref: React.Ref) { let start: React.ReactNode = (
  • index ? 'true' : 'false'} aria-posinset={index + 1} aria-setsize={count} diff --git a/tests/__snapshots__/simple.spec.js.snap b/tests/__snapshots__/simple.spec.js.snap index 3fabfc8..43deb96 100644 --- a/tests/__snapshots__/simple.spec.js.snap +++ b/tests/__snapshots__/simple.spec.js.snap @@ -3,7 +3,6 @@ exports[`rate allowHalf render works 1`] = `
    • Date: Fri, 24 Jan 2025 17:39:19 +0800 Subject: [PATCH 2/2] chore: not blame --- src/Star.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Star.tsx b/src/Star.tsx index 7b54f4d..7243069 100644 --- a/src/Star.tsx +++ b/src/Star.tsx @@ -79,10 +79,10 @@ function Star(props: StarProps, ref: React.Ref) { let start: React.ReactNode = (
    • index ? 'true' : 'false'} aria-posinset={index + 1} aria-setsize={count}