# TagInput

## 2026-08-13 — Portal the autocomplete dropdown so dialogs can't clip it

**Prompted by:** Hellen Tran (PO)

### What changed
- The autocomplete listbox now renders in a portal to `document.body` with
  fixed positioning under the control, instead of an `absolute` child.
- Position is measured from the control's bounding rect and kept in sync on
  scroll/resize while open.

### Why
- Inside a Dialog, the content panel is `overflow-y-auto`; an in-flow `absolute`
  dropdown was clipped at the dialog's edge (and could trigger the dialog's own
  scrollbar), so long suggestion lists appeared cut off / detached.
- Option activation stays on `onMouseDown` + `preventDefault`, which keeps focus
  in the input and prevents the surrounding Base UI Dialog from treating the
  click as an outside-press (so the dialog no longer risks closing).

### Affected tokens / files
- `packages/shadcn/src/components/ui/tag-input.tsx`
