diff --git a/src/components/input/SelectNext.tsx b/src/components/input/SelectNext.tsx index f977cd1fe..1fd197712 100644 --- a/src/components/input/SelectNext.tsx +++ b/src/components/input/SelectNext.tsx @@ -5,7 +5,6 @@ import { useContext, useId, useLayoutEffect, - useMemo, useRef, useState, } from 'preact/hooks'; @@ -286,10 +285,6 @@ function SelectMain({ const listboxId = useId(); const buttonRef = useSyncedRef(elementRef); const defaultButtonId = useId(); - const extraProps = useMemo( - () => (listboxAsPopover ? { popover: '' } : {}), - [listboxAsPopover], - ); useListboxPositioning( buttonRef, @@ -376,7 +371,6 @@ function SelectMain({
    ({ aria-orientation="vertical" data-testid="select-listbox" data-listbox-open={listboxOpen} + // nb. Use `undefined` rather than `false` because Preact doesn't + // handle boolean values correctly for this attribute (it will set + // `popover="false"` instead of removing the attribute). + popover={listboxAsPopover ? 'auto' : undefined} > {children}