diff --git a/plasmicpkgs/react-aria/src/registerComboBox.tsx b/plasmicpkgs/react-aria/src/registerComboBox.tsx index ef9d10d76f6..ba442c97729 100644 --- a/plasmicpkgs/react-aria/src/registerComboBox.tsx +++ b/plasmicpkgs/react-aria/src/registerComboBox.tsx @@ -48,7 +48,9 @@ export function BaseComboBox(props: BaseComboboxProps) { return ( - + { className?: string; resetClassName?: string; + defaultShouldFlip?: boolean; } export function BasePopover(props: BasePopoverProps) { const { resetClassName, setControlContextData, ...restProps } = props; const isStandalone = !React.useContext(PopoverContext); const context = React.useContext(PlasmicPopoverContext); - const isInsideSelect = !!React.useContext(SelectContext); const triggerRef = React.useRef(null); const isEditMode = !!usePlasmicCanvasContext(); - // Select/Combobox popovers should not flip by default - const defaultShouldFlip = isInsideSelect ? false : true; - const mergedProps = mergeProps( - { shouldFlip: defaultShouldFlip }, - context, + { + isOpen: context?.isOpen, + shouldFlip: context?.defaultShouldFlip, + }, /** * isNonModal: Whether the popover is non-modal, i.e. elements outside the popover may be interacted with by assistive technologies. * * @@ -55,7 +54,7 @@ export function BasePopover(props: BasePopoverProps) { ); setControlContextData?.({ - defaultShouldFlip, + defaultShouldFlip: context?.defaultShouldFlip ?? true, }); return ( @@ -145,7 +144,7 @@ export function registerPopover( type: "boolean", description: "Whether the element should flip its orientation (e.g. top to bottom or left to right) when there is insufficient room for it to render completely.", - defaultValueHint: (_props, ctx) => ctx?.defaultShouldFlip ?? true, + defaultValueHint: (_props, ctx) => ctx?.defaultShouldFlip, }, placement: { type: "choice", diff --git a/plasmicpkgs/react-aria/src/registerSelect.tsx b/plasmicpkgs/react-aria/src/registerSelect.tsx index cfdef55d42f..0f98d90919f 100644 --- a/plasmicpkgs/react-aria/src/registerSelect.tsx +++ b/plasmicpkgs/react-aria/src/registerSelect.tsx @@ -102,7 +102,9 @@ export function BaseSelect(props: BaseSelectProps) { isOpen={openProp} {...extractPlasmicDataProps(props)} > - +