[BUG] dcc.Dropdown: hidden focus-target input is focusable inside aria-hidden and can overflow its wrapper
Mantenedores costumam responder em até 2 dias
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 56/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Ativa
- Stack de tecnologia
- css, playwright, python, react, typescript
- Domínio
- accessibility, frontend
Direção de pesquisa
Comece em components/dash-core-components/src/fragments/Dropdown.tsx (o input.dash-dropdown-focus-target oculto com aria-hidden e tabIndex) e src/components/css/dropdown.css (se posicionamento absolute, largura ilimitada). Reproduza com o layout mínimo do issue, verificando document.documentElement.scrollWidth e executando axe-core para a violação aria-hidden-focus. Está pronto quando o alvo de foco deixa de alargar a página e nenhum conteúdo focável fica dentro de aria-hidden, mantendo o comportamento de ordem de tabulação do Safari que a solução contorna; verifique se os testes existentes de Dropdown na suíte de testes do dash-core-components ainda passam.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Thank you for Dash!
Describe your context
dash 4.5.0rc0
(the same code is on dev today: components/dash-core-components/src/fragments/Dropdown.tsx and src/components/css/dropdown.css)
- OS: Linux
- Browser: Chromium 151 (headless, via Playwright) with axe-core
Describe the bug
The hidden input.dash-dropdown-focus-target that dcc.Dropdown renders (the Safari tab-order workaround) causes two problems:
-
It is focusable inside
aria-hidden. It hasaria-hidden="true"andtabIndex={0}(while the trigger<button>istabIndex={-1}), so the only tab stop for every dropdown is hidden from assistive technology. axe-core reportsaria-hidden-focus(serious) once perdcc.Dropdownon the page: "Focusable content should be disabled or be removed from the DOM". -
It can widen the page. Its CSS is only
position: absolute; opacity: 0; pointer-events: none;, so it keeps the browser's default input width (about 215px in Chromium) and is anchored atleft: 0of the wrapper. A dropdown narrower than that, near the right edge of a flex row, pushes the input past the viewport: in our app a 600px-wide viewport gotdocument.documentElement.scrollWidth === 648(horizontal scrolling on mobile). Addingmax-width: 100%(orwidth: 100%/inset: 0) to.dash-dropdown-focus-targetfixes it; we use this override for now:.dash-dropdown-wrapper .dash-dropdown-focus-target { max-width: 100%; }
Minimal example:
from dash import Dash, dcc, html
app = Dash(__name__)
app.layout = html.Div(
[html.Div(style={"flex": "1"}), dcc.Dropdown(["a", "b"], placeholder="Pick", style={"width": "140px"})],
style={"display": "flex", "width": "100%"},
)
if __name__ == "__main__":
app.run()
At a 200px-wide viewport, document.documentElement.scrollWidth is 237 because of the focus input, and axe-core reports one aria-hidden-focus violation on it.
Expected behavior
- No focusable element inside
aria-hidden. For example, droparia-hiddenfrom the workaround input and give it the dropdown's accessible name, or make the trigger button itself the tab stop where the browser supports it. I don't know which works best with the Safari behaviour the workaround targets. - The hidden input never takes more space than its wrapper (
max-width: 100%indropdown.css).
Screenshots
n/a
- Linguagem predominante
- Python
- Estrelas
- 24.4k
- Forks
- 2.3k
- Merge médio
- 2d 14h
- PRs com merge (30d)
- 23
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
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 plotly/dash
-
P2 plotly-internal size: 1 task
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 2 dias
-
Extract graph schema validation into properly named testTalvez já em andamento @Nice6042 assumiu há 60 dias. Abertagood first issue P3 size: 1 task
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
plotly/dash#3735 · 3 comentários ·
Mantenedores costumam responder em até 2 dias
-
P3 plotly-internal size: 10+ task
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 30/100
plotly/dash#4040 · 3 comentários ·
Mantenedores costumam responder em até 2 dias
-
Drop Python 3.9 SupportAbertaP2 plotly-internal size: 5 task
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 35/100
plotly/dash#4038 · 2 comentários ·
Mantenedores costumam responder em até 2 dias
-
[BUG] Setting children to None leaves removed components registered: their callbacks keep firing and the subtree can never be mounted againTalvez já em andamento @0d00ciallo0721 assumiu há 6 dias. Abertabug P3 size: 3
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 62/100
plotly/dash#4033 · 1 comentário ·
Mantenedores costumam responder em até 2 dias
Todas as issues de plotly/dash
Issues semelhantes
-
enhancement from-review
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
khuisman/mcp-gee-sweet#1010 ·
Mantenedores costumam responder em até 1 dia
-
bug confirmed issue
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
open-webui/open-webui#32333 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
ll7/robot_sf_ll7#10368 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
-
mcp: a write that loses its answer is reported as "cannot reach", although it may have landedAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
flop-labs/technocore-chat#982 ·
Mantenedores costumam responder em até 1 dia