` | Floating positioned container |
| `Autocomplete.Popup` | `
` | Visual wrapper for the option list |
@@ -108,7 +110,7 @@ In this pattern, keep the outer `Popover` or `Dialog` as the source of truth for
| `label` | `string` | falls back to `value` | Display label, also used for input text on selection |
| `disabled` | `boolean` | — | Prevents selection |
-### `Autocomplete.Input`, `Autocomplete.Positioner`, `Autocomplete.Popup`, `Autocomplete.List`
+### `Autocomplete.Input`, `Autocomplete.Trigger`, `Autocomplete.Positioner`, `Autocomplete.Popup`, `Autocomplete.List`
No additional props beyond standard HTML attributes and the `render` prop.
@@ -131,7 +133,7 @@ Navigation loops and auto-scrolls the active option into view.
| Attribute | Applies To | Description |
| --------------------------- | ----------------- | ------------------------------- |
-| `data-open` / `data-closed` | Input | Popup open state |
+| `data-open` / `data-closed` | Input, Trigger | Popup open state |
| `data-selected` | Option | The currently selected option |
| `data-active` | Option | The keyboard-highlighted option |
| `data-disabled` | Option | Disabled option |
@@ -140,6 +142,7 @@ Navigation loops and auto-scrolls the active option into view.
## Open/Close Behavior
- Typing a non-empty string opens the popup automatically.
+- Activating `Trigger` toggles the popup and returns focus to the input.
- Clearing the input closes the popup.
- Clicking an option closes the popup and returns focus to the input.
- Outside click and Escape close the popup.
@@ -147,5 +150,6 @@ Navigation loops and auto-scrolls the active option into view.
## ARIA
- Input: `aria-autocomplete="list"`, `aria-activedescendant` (virtual focus)
+- Trigger: `tabindex="-1"`, `aria-controls`, `aria-expanded`
- Options: `role="option"`, `aria-selected`, `aria-disabled`
- Focus manager: non-modal, `initialFocus={-1}` (focus stays on input)
diff --git a/packages/headless/src/primitives/autocomplete/autocomplete-context.ts b/packages/headless/src/primitives/autocomplete/autocomplete-context.ts
index 3fae09aff96..4dd7327e5e0 100644
--- a/packages/headless/src/primitives/autocomplete/autocomplete-context.ts
+++ b/packages/headless/src/primitives/autocomplete/autocomplete-context.ts
@@ -25,11 +25,15 @@ export interface AutocompleteContextValue {
elementsRef: React.MutableRefObject
>;
labelsRef: React.MutableRefObject>;
popupRef: React.RefObject;
+ triggerRef: React.MutableRefObject;
arrowRef: React.MutableRefObject;
valuesByIndexRef: React.MutableRefObject