File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed
packages/kit-headless/src/components/tabs Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -134,9 +134,11 @@ export const Tab = component$(
134
134
}
135
135
} ) ;
136
136
137
+ const uniqueId = useId ( ) ;
138
+
137
139
return (
138
140
< button
139
- id = { useId ( ) }
141
+ id = { uniqueId }
140
142
type = "button"
141
143
role = "tab"
142
144
onFocus$ = { selectIfAutomatic }
@@ -173,9 +175,10 @@ export const TabPanel = component$(({ ...props }: TabPanelProps) => {
173
175
useVisibleTask$ ( async ( ) => {
174
176
thisPanelIndex . value = await contextService . getNextPanelIndex ( ) ;
175
177
} ) ;
178
+ const uniqueId = useId ( ) ;
176
179
return (
177
180
< div
178
- id = { useId ( ) }
181
+ id = { uniqueId }
179
182
role = "tabpanel"
180
183
tabIndex = { 0 }
181
184
aria-labelledby = { `tab-${ thisPanelIndex } ` }
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ const media = {
28
28
29
29
export const ExampleNetflix = component$ ( ( ) => {
30
30
const { scopeId } = useStylesScoped$ ( styles ) ;
31
- const items = useSignal ( [ ...new Array ( 10 ) ] ) ;
31
+ const items = useSignal ( [ ...new Array ( 10 ) ] . map ( ( _ , i ) => i ) ) ;
32
32
const carousel = useCarousel ( { loop : false , transition : 350 , startAt : 3 } ) ;
33
33
34
34
return (
@@ -42,9 +42,9 @@ export const ExampleNetflix = component$(() => {
42
42
43
43
< Root use = { carousel } >
44
44
< Items class = { [ scopeId , 'qui-carousel' ] } >
45
- { items . value . map ( ( _ , i ) => (
45
+ { items . value . map ( ( val , i ) => (
46
46
< Item
47
- key = { useId ( ) }
47
+ key = { val }
48
48
index = { i }
49
49
label = { media . title }
50
50
class = { [ scopeId , 'carousel__card' ] }
You can’t perform that action at this time.
0 commit comments