1
1
import { FloatingFocusManager , FloatingPortal } from '@floating-ui/react' ;
2
2
import { useVirtualizer } from '@tanstack/react-virtual' ;
3
3
import cl from 'clsx/lite' ;
4
- import { forwardRef , useEffect , useId , useRef , useState } from 'react' ;
4
+ import { forwardRef , useEffect , useRef , useState } from 'react' ;
5
5
import type { InputHTMLAttributes , ReactNode } from 'react' ;
6
6
7
7
import type { PortalProps } from '../../../types/Portal' ;
@@ -156,8 +156,6 @@ export const ComboboxComponent = forwardRef<HTMLInputElement, ComboboxProps>(
156
156
const portalRef = useRef < HTMLDivElement > ( null ) ;
157
157
const listRef = useRef < Array < HTMLElement | null > > ( [ ] ) ;
158
158
159
- const listId = useId ( ) ;
160
-
161
159
const [ inputValue , setInputValue ] = useState < string > ( rest . inputValue || '' ) ;
162
160
163
161
useEffect ( ( ) => {
@@ -392,7 +390,7 @@ export const ComboboxComponent = forwardRef<HTMLInputElement, ComboboxProps>(
392
390
< ComboboxInput
393
391
{ ...omit ( [ 'inputValue' ] , rest ) }
394
392
hideClearButton = { hideClearButton }
395
- listId = { listId }
393
+ listId = { context . floatingId }
396
394
error = { error }
397
395
hideChips = { hideChips }
398
396
handleKeyDown = { handleKeyDown }
@@ -413,7 +411,6 @@ export const ComboboxComponent = forwardRef<HTMLInputElement, ComboboxProps>(
413
411
visuallyHiddenDismiss
414
412
>
415
413
< div
416
- id = { listId }
417
414
aria-labelledby = { formFieldProps . inputProps . id }
418
415
aria-autocomplete = 'list'
419
416
tabIndex = { - 1 }
0 commit comments