Fix mobile locale select under drawer
Select menus portal at z-3 while drawers sit at z-5, so the popup opened behind the drawer. Portal into the drawer panel instead. Point .env.example VITE_API_URL at the slug subdomain with a local Vite note. Signed-off-by: Émile Ré <emile@probo.com>
This commit is contained in:
@@ -33,15 +33,21 @@ export type DrawerPopupProps
|
||||
|
||||
// Portal + dimmed backdrop + edge-aligned popup. Children compose the header /
|
||||
// body / footer regions inside Base UI's Content (swipe-safe text selection).
|
||||
// `ref` lands on the Popup panel (not the viewport) so nested menus can portal
|
||||
// into the drawer stacking context.
|
||||
export function DrawerPopup(props: DrawerPopupProps) {
|
||||
const { className, children, side, ...popupProps } = props;
|
||||
const { className, children, side, ref, ...popupProps } = props;
|
||||
const slots = drawer({ side });
|
||||
|
||||
return (
|
||||
<BaseDrawer.Portal>
|
||||
<BaseDrawer.Backdrop className={slots.backdrop()} />
|
||||
<BaseDrawer.Viewport className={slots.viewport()}>
|
||||
<BaseDrawer.Popup className={slots.popup({ className })} {...popupProps}>
|
||||
<BaseDrawer.Popup
|
||||
ref={ref}
|
||||
className={slots.popup({ className })}
|
||||
{...popupProps}
|
||||
>
|
||||
<BaseDrawer.Content className={slots.content()}>
|
||||
{children}
|
||||
</BaseDrawer.Content>
|
||||
|
||||
@@ -27,6 +27,9 @@ export type SelectPopupProps
|
||||
= & Omit<ComponentProps<typeof BaseSelect.Popup>, "className">
|
||||
& {
|
||||
className?: string;
|
||||
// Mount inside a modal/drawer so the menu stacks above that layer
|
||||
// (body portal uses z-3, below drawers at z-5).
|
||||
container?: ComponentProps<typeof BaseSelect.Portal>["container"];
|
||||
// Positioner placement passthrough.
|
||||
side?: ComponentProps<typeof BaseSelect.Positioner>["side"];
|
||||
align?: ComponentProps<typeof BaseSelect.Positioner>["align"];
|
||||
@@ -36,13 +39,13 @@ export type SelectPopupProps
|
||||
// Portal + positioner + styled popup holding the select items.
|
||||
export function SelectPopup(props: SelectPopupProps) {
|
||||
const {
|
||||
className, children,
|
||||
className, children, container,
|
||||
side = "bottom", align = "start", sideOffset = 4,
|
||||
...popupProps
|
||||
} = props;
|
||||
|
||||
return (
|
||||
<BaseSelect.Portal>
|
||||
<BaseSelect.Portal container={container}>
|
||||
{/* z-3 on the Positioner so the portaled root wins over in-page z-1. */}
|
||||
<BaseSelect.Positioner className="z-3" side={side} align={align} sideOffset={sideOffset}>
|
||||
<BaseSelect.Popup className={selectPopup({ className })} {...popupProps}>
|
||||
|
||||
Reference in New Issue
Block a user