File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
packages/qwik-storefront-ui/src/components/SfRating Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 1- import { component$ } from '@builder.io/qwik' ;
1+ import { component$ , useId } from '@builder.io/qwik' ;
22import { SfIconStar , SfIconStarFilled , SfIconStarHalf } from '../SfIcons' ;
33import { SfRatingProps , SfRatingSize } from './types' ;
44
@@ -20,6 +20,7 @@ export const SfRating = component$<SfRatingProps>(
2020 class : _class ,
2121 ...attributes
2222 } ) => {
23+ const uniqueId = useId ( ) ;
2324 const clamp = ( value : number , min : number , max : number ) => {
2425 return Math . min ( Math . max ( value , min ) , max ) ;
2526 } ;
@@ -48,7 +49,7 @@ export const SfRating = component$<SfRatingProps>(
4849 < SfIconStarFilled
4950 aria-hidden = "true"
5051 class = "w-[1.5em] h-[1.5em]"
51- key = { '1' + i }
52+ key = { ` ${ uniqueId } -filled- ${ i } ` }
5253 />
5354 ) ) }
5455 { Boolean ( partiallyFilled ) && (
@@ -58,7 +59,7 @@ export const SfRating = component$<SfRatingProps>(
5859 < SfIconStar
5960 aria-hidden = "true"
6061 class = "text-disabled-500 w-[1.5em] h-[1.5em]"
61- key = { '2' + i }
62+ key = { ` ${ uniqueId } - ${ i } ` }
6263 />
6364 ) ) }
6465 </ div >
You can’t perform that action at this time.
0 commit comments