Combobox: mounting open moves focus into the input even without autoFocus
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 69/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- accessibility, frontend
Research direction
Start by locating the combobox state machine and its input focus handling, then trace how mounting with defaultOpen differs from opening by click or key. Reproduce with autoFocus off and check document.activeElement; done means mount leaves focus in place while user-triggered opening still focuses the input.
Written by the indexing model from the issue text.
Description
🐛 Bug report
A combobox that mounts open moves focus into its input, even with autoFocus off. With defaultOpen, the page loads with focus inside the combobox instead of at the top.
💥 Steps to reproduce
- Render a combobox with
defaultOpenand withoutautoFocus, below some other focusable content. - Load the page.
- Check
document.activeElement. It's the combobox input.
💻 Link to reproduction
No sandbox yet. Any combobox example with defaultOpen shows it.
🧐 Expected behavior
Focus only moves on mount when autoFocus is set. Opening from a click or a key still focuses the input, as it does today.
🌍 System information
| Software | Version(s) |
|---|---|
| Zag Version | 1.49.0, and 2.0.0-next.4 |
| Browser | Any |
| Operating System | Any |
🧢 Your Company/Team
- Dominant language
- TypeScript
- Stars
- 5.3k
- Forks
- 320
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 60
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from chakra-ui/zag
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
date-input: zoned values show in the timeZone prop (UTC) instead of their own zonePossibly taken @Yahiro025 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
dismissable: LayerDismissEvent isn't exportedPossibly taken @abu-tahir-0 claimed this today. Open
Difficulty 1/5 Under an hour Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
Slider: marker data-state ignores origin "center" / "end"Possibly taken @itisrmk claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
Maintainers usually reply within 1 day
Similar issues
-
bug engine
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
frostney/GocciaScript#2539 ·
Maintainers usually reply within 1 day
-
Fish Audio Live calls fail to start: `Unknown callback "onNotice"` from @fishaudio/agent-clientPossibly taken @NEAL3K claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
milind-soni/OpenMausBot#8345 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
ardia-browser/ardia#6142 ·
Maintainers usually reply within 1 day
-
feature
Difficulty 1/5 Under an hour Newbie friendliness 78/100
ChromeDevTools/chrome-devtools-mcp#3689 ·
Maintainers usually reply within 1 day
-
bug from-app needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
nightly-labs/openbot#21303 ·
Maintainers usually reply within 1 day