File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -286,10 +286,6 @@ function SelectMain<T>({
286
286
const listboxId = useId ( ) ;
287
287
const buttonRef = useSyncedRef ( elementRef ) ;
288
288
const defaultButtonId = useId ( ) ;
289
- const extraProps = useMemo (
290
- ( ) => ( listboxAsPopover ? { popover : '' } : { } ) ,
291
- [ listboxAsPopover ] ,
292
- ) ;
293
289
294
290
useListboxPositioning (
295
291
buttonRef ,
@@ -376,7 +372,6 @@ function SelectMain<T>({
376
372
</ button >
377
373
< SelectContext . Provider value = { { selectValue, value } } >
378
374
< ul
379
- { ...extraProps }
380
375
className = { classnames (
381
376
'absolute z-5 max-h-80 overflow-y-auto' ,
382
377
'rounded border bg-white shadow hover:shadow-md focus-within:shadow-md' ,
@@ -397,6 +392,10 @@ function SelectMain<T>({
397
392
aria-orientation = "vertical"
398
393
data-testid = "select-listbox"
399
394
data-listbox-open = { listboxOpen }
395
+ // nb. Use `undefined` rather than `false` because Preact doesn't
396
+ // handle boolean values correctly for this attribute (it will set
397
+ // `popover="false"` instead of removing the attribute).
398
+ popover = { listboxAsPopover ? 'auto' : undefined }
400
399
>
401
400
{ children }
402
401
</ ul >
You can’t perform that action at this time.
0 commit comments