ensure we always set portal to true when the anchor props is truthy

We already had this for most components, but I missed it for this
component. This fixes that.
This commit is contained in:
Robin Malfait
2024-04-29 20:28:22 +02:00
parent beaae6a3f3
commit 872808c8fc
@@ -1576,6 +1576,11 @@ function OptionsFn<TTag extends ElementType = typeof DEFAULT_OPTIONS_TAG>(
let actions = useActions('Combobox.Options')
let anchor = useResolvedAnchor(rawAnchor)
// Always enable `portal` functionality, when `anchor` is enabled
if (anchor) {
portal = true
}
let [floatingRef, style] = useFloatingPanel(anchor)
let getFloatingPanelProps = useFloatingPanelProps()
let optionsRef = useSyncRefs(data.optionsRef, ref, anchor ? floatingRef : null)