Escape inside a focused submenu closes the entire Dropdown instead of returning to its parent item
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 67/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- react, typescript
- Domínio
- accessibility, frontend
Direção de pesquisa
Start with src/hooks/useAccessibility.ts and trace how Escape is handled when focus is inside a nested Menu submenu. Reproduce the reported sequence in Chrome: open the Dropdown, focus Submenu, open it with ArrowRight, then press Escape. Done means the submenu closes, focus returns to its parent menuitem, and the parent Dropdown stays open without calling onOpenChange(false).
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Reproduction
import Dropdown from '@rc-component/dropdown';
import Menu from '@rc-component/menu';
<Dropdown trigger={['click']} overlay={
<Menu items={[{ key: 'sub', label: 'Submenu', children: [
{ key: 'child', label: 'Child' },
] }]} />
}>
<button>Nested actions</button>
</Dropdown>
- Click the trigger.
- Press Tab to focus Submenu.
- Press ArrowRight to open the submenu and focus Child.
- Press Escape once.
Actual: both the submenu and parent Dropdown close, onOpenChange(false) runs, and focus goes to the Dropdown trigger.
Expected: close the submenu that contains focus and return focus to its parent menuitem; leave the parent Dropdown open. This follows the Escape behavior in the APG menu pattern.
Verification and scope
Reproduced with real Chrome key presses on macOS, using the source at PR #273 head b22af69306b82d60e64c6f513956564d019fe781 and again with only src/hooks/useAccessibility.ts restored from its base b4ea62f3293851934d64d9d92cbbd07d87a40dea. Both have this behavior, so this is an existing integration problem, not a regression introduced by #273. The single-level Escape focus fix in #273 works in the same native-browser comparison.
Dependencies: React/ReactDOM 19.3.1, menu 1.6.0, trigger 3.10.1, portal 2.2.1. Dependencies were installed in an isolated checkout from declared ranges (no upstream lockfile). An independent jsdom Dropdown/Menu integration test also observes the parent-close callback in both hook versions. No screen-reader conformance claim.
Checked open/closed submenu and Escape issue/PR searches here before filing. #38 concerns old menu-v6 layout; #272/#273 concern single-level Escape focus return. No duplicate source patch opened. AI-assisted reproduction and report; the described browser actions and tests were executed locally.
- Linguagem predominante
- TypeScript
- Estrelas
- 181
- Forks
- 112
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Preparar o ambiente
Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de react-component/dropdown
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 55/100
react-component/dropdown#272 ·
-
safari 浏览器手势放大后下拉菜单位置不正确Aberta
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 45/100
react-component/dropdown#245 ·
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 35/100
react-component/dropdown#242 ·
-
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 15/100
react-component/dropdown#241 ·
-
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 20/100
react-component/dropdown#231 ·
Todas as issues de react-component/dropdown
Issues semelhantes
-
Remove unused dependenciesTalvez já em andamento @alastair-smith assumiu hoje. Abertachore other
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
alastair-smith/card-games#384 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
code-yeongyu/senpi#5571 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
nexu-io/open-design#9262 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
friction
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
kentcdodds/kody#4753 ·
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 62/100
lingdojo/kana-dojo#33508 · 1 comentário · 5 reações ·
Mantenedores costumam responder em até 1 dia