From 5134cac993cfe179be9f5125fe57a28e4450e137 Mon Sep 17 00:00:00 2001 From: Dotta Date: Thu, 5 Mar 2026 17:23:01 -0600 Subject: [PATCH] fix(ui): fix mobile popover issues in InlineEntitySelector Force popover to always open downward (side="bottom") to prevent it from flipping upward and going off-screen on mobile. Skip auto-focusing the search input on touch devices so the virtual keyboard doesn't open and reshape the viewport. Add touch-manipulation on option buttons to remove tap delays and improve scroll gesture recognition. Co-Authored-By: Claude Opus 4.6 --- ui/src/components/InlineEntitySelector.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ui/src/components/InlineEntitySelector.tsx b/ui/src/components/InlineEntitySelector.tsx index ca2c5402..0c274b56 100644 --- a/ui/src/components/InlineEntitySelector.tsx +++ b/ui/src/components/InlineEntitySelector.tsx @@ -106,11 +106,18 @@ export const InlineEntitySelector = forwardRef { event.preventDefault(); - inputRef.current?.focus(); + // On touch devices, don't auto-focus the search input to avoid + // opening the virtual keyboard which reshapes the viewport and + // pushes the popover off-screen. + const isTouch = window.matchMedia("(pointer: coarse)").matches; + if (!isTouch) { + inputRef.current?.focus(); + } }} onCloseAutoFocus={(event) => { if (!shouldPreventCloseAutoFocusRef.current) return; @@ -170,7 +177,7 @@ export const InlineEntitySelector = forwardRef setHighlightedIndex(index)}