File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -278,6 +278,7 @@ export const ProviderModelPicker = memo(function ProviderModelPicker(props: {
278278 align = "start"
279279 className = "before:hidden"
280280 padding = "none"
281+ touchBackdrop
281282 >
282283 < ModelPickerContent
283284 environmentId = { props . environmentId }
Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ function PopoverPopup({
4343 tooltipStyle = false ,
4444 keepMounted = false ,
4545 anchor,
46+ touchBackdrop = false ,
4647 ...props
4748} : PopoverPrimitive . Popup . Props & {
4849 padding ?: keyof typeof popoverViewportPaddingClassName ;
@@ -56,12 +57,22 @@ function PopoverPopup({
5657 keepMounted ?: PopoverPrimitive . Portal . Props [ "keepMounted" ] ;
5758 anchor ?: PopoverPrimitive . Positioner . Props [ "anchor" ] ;
5859 width ?: keyof typeof popoverPopupWidthClassName ;
60+ touchBackdrop ?: boolean ;
5961} ) {
6062 // Viewport rekeys its children when the active trigger clears on close. Persistent
6163 // single-trigger forms need a stable container to retain drafts and submit guards.
6264 const Viewport = keepMounted ? "div" : PopoverPrimitive . Viewport ;
6365 return (
6466 < PopoverPrimitive . Portal keepMounted = { keepMounted } >
67+ { touchBackdrop ? (
68+ // A non-modal popover closes on an outside tap and lets that tap reach the
69+ // control under the finger. On touch screens the backdrop takes the tap, so
70+ // tapping away only closes the popover, as it does for modal menus and selects.
71+ < PopoverPrimitive . Backdrop
72+ className = "fixed inset-0 z-[130] hidden pointer-coarse:block"
73+ data-slot = "popover-backdrop"
74+ />
75+ ) : null }
6576 < PopoverPrimitive . Positioner
6677 align = { align }
6778 alignOffset = { alignOffset }
You can’t perform that action at this time.
0 commit comments