File tree 1 file changed +4
-1
lines changed
src/components/Autocomplete/components/ComboBox 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import {Popover, PopoverProps} from '../../../Popover';
8
8
import { ActionListItemDescriptor , Key } from '../../../../types' ;
9
9
import { KeypressListener } from '../../../KeypressListener' ;
10
10
import { EventListener } from '../../../EventListener' ;
11
+ import { isServer } from '../../../../utilities/target' ;
11
12
12
13
import { ComboBoxContext } from './context' ;
13
14
import styles from './ComboBox.scss' ;
@@ -70,6 +71,8 @@ export function ComboBox({
70
71
setFalse : forcePopoverActiveFalse ,
71
72
} = useToggle ( false ) ;
72
73
74
+ const useIsomorphicLayoutEffect = isServer ? useEffect : useLayoutEffect ;
75
+
73
76
const id = useUniqueId ( 'ComboBox' , idProp ) ;
74
77
75
78
const getActionsWithIds = useCallback (
@@ -240,7 +243,7 @@ export function ComboBox({
240
243
}
241
244
} , [ selected , selectedOptions ] ) ;
242
245
243
- useLayoutEffect ( ( ) => {
246
+ useIsomorphicLayoutEffect ( ( ) => {
244
247
let newNavigableOptions : (
245
248
| OptionDescriptor
246
249
| ActionListItemDescriptor
You can’t perform that action at this time.
0 commit comments