File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -307,11 +307,12 @@ export function Item(itemProps: Partial<ItemProps> & {item?: ItemInput}): JSX.El
307307 onKeyPress,
308308 children,
309309 onClick,
310- id : _id ,
310+ id,
311311 ...props
312312 } = itemProps
313313
314- const id = useMemo ( ( ) => _id ?? uniqueId ( ) , [ _id ] )
314+ const labelId = useMemo ( ( ) => uniqueId ( ) , [ ] )
315+ const descriptionId = useMemo ( ( ) => uniqueId ( ) , [ ] )
315316
316317 const keyPressHandler = useCallback (
317318 event => {
@@ -357,8 +358,8 @@ export function Item(itemProps: Partial<ItemProps> & {item?: ItemInput}): JSX.El
357358 variant = { variant }
358359 showDivider = { showDivider }
359360 aria-selected = { selected }
360- aria-labelledby = { text ? ` ${ id } -label` : undefined }
361- aria-describedby = { description ? ` ${ id } -description` : undefined }
361+ aria-labelledby = { text ? labelId : undefined }
362+ aria-describedby = { description ? descriptionId : undefined }
362363 { ...props }
363364 data-id = { id }
364365 onKeyPress = { keyPressHandler }
You can’t perform that action at this time.
0 commit comments