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$(
134134 }
135135 } ) ;
136136
137+ const uniqueId = useId ( ) ;
138+
137139 return (
138140 < button
139- id = { useId ( ) }
141+ id = { uniqueId }
140142 type = "button"
141143 role = "tab"
142144 onFocus$ = { selectIfAutomatic }
@@ -173,9 +175,10 @@ export const TabPanel = component$(({ ...props }: TabPanelProps) => {
173175 useVisibleTask$ ( async ( ) => {
174176 thisPanelIndex . value = await contextService . getNextPanelIndex ( ) ;
175177 } ) ;
178+ const uniqueId = useId ( ) ;
176179 return (
177180 < div
178- id = { useId ( ) }
181+ id = { uniqueId }
179182 role = "tabpanel"
180183 tabIndex = { 0 }
181184 aria-labelledby = { `tab-${ thisPanelIndex } ` }
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ const media = {
2828
2929export const ExampleNetflix = component$ ( ( ) => {
3030 const { scopeId } = useStylesScoped$ ( styles ) ;
31- const items = useSignal ( [ ...new Array ( 10 ) ] ) ;
31+ const items = useSignal ( [ ...new Array ( 10 ) ] . map ( ( _ , i ) => i ) ) ;
3232 const carousel = useCarousel ( { loop : false , transition : 350 , startAt : 3 } ) ;
3333
3434 return (
@@ -42,9 +42,9 @@ export const ExampleNetflix = component$(() => {
4242
4343 < Root use = { carousel } >
4444 < Items class = { [ scopeId , 'qui-carousel' ] } >
45- { items . value . map ( ( _ , i ) => (
45+ { items . value . map ( ( val , i ) => (
4646 < Item
47- key = { useId ( ) }
47+ key = { val }
4848 index = { i }
4949 label = { media . title }
5050 class = { [ scopeId , 'carousel__card' ] }
You can’t perform that action at this time.
0 commit comments