[Bug]: Embedded number/range inputs contribute their `value` attribute, not their current value, to accessible names
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Estancado
- Stack tecnológico
- playwright, typescript
- Área
- accessibility, testing
Línea de trabajo
Start in packages/injected/src/roleUtils.ts at the progressbar/scrollbar/slider/spinbutton/meter branch of getTextAlternativeInternal; compare its value handling with the textbox branch above. Reproduce with the supplied test and check existing accessible-name tests for the right place to add coverage. Done means embedded number and range inputs contribute their current values to the containing checkbox names; an open linked pull request (#43985) is already addressing this issue.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Version
1.65.0 (also 1.66.0-alpha-1793916328000)
Steps to reproduce
- Clone https://github.com/trackoor/playwright-accname-range-number-repro
npm install && npx playwright install chromiumnpm test
The test:
import { test, expect } from '@playwright/test';
test('embedded number/range inputs use their current value in accessible names', async ({ page }) => {
await page.setContent(`
<input type="checkbox" id="cb"><label for="cb">Remind me <input type="number" value="3" aria-label="count"> times</label>
<input type="checkbox" id="v"><label for="v">Volume <input type="range" aria-label="vol"> percent</label>
<input type="checkbox" id="w"><label for="w">Level <input type="range" max="10" value="70" aria-label="lvl"> of 10</label>
`);
await page.getByLabel('count').fill('5');
const boxes = page.getByRole('checkbox');
await expect(boxes.nth(0)).toHaveAccessibleName('Remind me 5 times');
await expect(boxes.nth(1)).toHaveAccessibleName('Volume 50 percent');
await expect(boxes.nth(2)).toHaveAccessibleName('Level 10 of 10');
});
Expected behavior
The checkbox names are Remind me 5 times, Volume 50 percent and Level 10 of 10. That is what Chromium itself computes (Accessibility.getFullAXTree over CDP), and the embedded spinbutton/slider in ariaSnapshot() already shows "5", "50" and "10".
Actual behavior
Expected: "Remind me 5 times"
Received: "Remind me 3 times"
page.locator('body').ariaSnapshot() shows all three:
- checkbox "Remind me 3 times"
- text: Remind me
- spinbutton "count": "5"
- text: times
- checkbox "Volume percent"
- text: Volume
- slider "vol": "50"
- text: percent
- checkbox "Level 70 of 10"
- text: Level
- slider "lvl": "10"
- text: of 10
Additional context
In packages/injected/src/roleUtils.ts, the progressbar/scrollbar/slider/spinbutton/meter branch of getTextAlternativeInternal falls back to element.getAttribute('value'). For <input> it should use the .value property, like the textbox branch just above it does. Same line on main at 07c7069.
Environment
System:
OS: Linux (x64)
Binaries:
Node: 26.13.0
npmPackages:
@playwright/test: 1.65.0
Credit: https://ucsbplse.github.io/
- Lenguaje dominante
- TypeScript
- Estrellas
- 99.1k
- Forks
- 6.8k
- Merge medio
- 17 h 6 min
- PR fusionados (30 d)
- 306
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de microsoft/playwright
-
Dificultad 3/5 1-2 días Aptitud para principiantes 76/100
microsoft/playwright#43987 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 72/100
microsoft/playwright#43986 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 64/100
microsoft/playwright#43983 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
microsoft/playwright#43981 ·
Los mantenedores suelen responder en 1 día
-
needs-triage
Dificultad 5/5 Más de una semana Aptitud para principiantes 30/100
microsoft/playwright#43969 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de microsoft/playwright
Issues similares
-
FR: Support CJK brackets, symbols and full-width markers in footnoteHeuristics (EBPAJ support)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
readest/readest#7413 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
content triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
eliasstravik/herdr-projects#788 ·
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Ability to edit tagsAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día