[Bug]: fill() on a paragraph inside a contenteditable body in an iframe resolves but inserts nothing
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 18/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Estancado
- Stack tecnológico
- typescript
- Área
- testing
Línea de trabajo
Start by reproducing the report with the snippet in the issue, using Chrome in headless mode, and note that fill() succeeds while the <p> text never changes. The issue points to focus handling: fill() should focus the nearest [contenteditable] ancestor when the target is not focusable, as it does for inputs. Check the already-open pull request #43487 first, since someone is working on this. Done means the reproduction passes and the <p> inside an iframe's <body contenteditable> is filled.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Version
1.63.0
Steps to reproduce
import { test, expect } from '@playwright/test';
test('fill a paragraph of an editor in an iframe', async ({ page }) => {
await page.setContent(`<iframe srcdoc="<body contenteditable><p id=p>old</p></body>"></iframe>`);
const frame = page.frames()[1];
await frame.locator('#p').waitFor();
await frame.locator('#p').fill('new'); // resolves without error
await expect(frame.locator('#p')).toHaveText('new'); // fails: still "old"
});
Expected behavior
fill() replaces the paragraph's text with new, or throws.
Actual behavior
fill() resolves, and nothing is inserted anywhere: the paragraph keeps old.
The target is editable (isContentEditable is inherited from the <body contenteditable>), but it is not focusable itself, and its frame's document does not have focus, so the inserted text goes to whichever document has focus. Observations:
frame.locator('body').fill('new')works (the editing host is focused).- Focusing the editing host first makes the paragraph fill work:
await frame.locator('#p').evaluate(el => el.closest('[contenteditable]').focus()). - The same happens in the top page when another frame has focus: a
<p>inside<div contenteditable>is not filled while an iframe's document is focused. - Seen on a real editor: the TinyMCE demo at https://the-internet.herokuapp.com/iframe (its
<p>inside the editor frame).
Perhaps fill() could focus the element's editing host (the nearest [contenteditable] ancestor) when the target itself is not focusable, as it focuses inputs. Possibly related, but a different cause (an editor's focus handler): #39492.
Additional context
We work around it in a tool built on Playwright by focusing the nearest editing host before fill().
Environment
- Playwright (playwright-core) 1.63.0, Node.js 24.21.0
- Google Chrome 155.0.8059.80 (
channel: 'chrome'), headless - macOS 27 (arm64)
- Lenguaje dominante
- TypeScript
- Estrellas
- 97.4k
- Forks
- 6.6k
- Merge medio
- 18 h 15 min
- PR fusionados (30 d)
- 318
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
-
[Feature]: Set `this.name` in `TargetClosedError` constructorQuizá libre de nuevo @LeonxLJX la tomó hace 43 días y no hay ningún pull request abierto. AbiertoP3-collecting-feedback
Dificultad 1/5 Menos de una hora Aptitud para principiantes 86/100
microsoft/playwright#42522 · 7 comentarios ·
Los mantenedores suelen responder en 1 día
-
[Bug]: ariaSnapshot() emits \uXXXX / \b escapes in role names that toMatchAriaSnapshot() parses back incorrectlyPosiblemente ocupada @alok-108 la tomó hoy. Abierto
Dificultad 3/5 Medio día Aptitud para principiantes 22/100
microsoft/playwright#43489 ·
Los mantenedores suelen responder en 1 día
-
[Bug]: Chromium – locale is not applied to Accept-Language / navigator.languages inside dedicated WorkersPosiblemente ocupada @yury-s la tomó hoy. Abierto
Dificultad 3/5 Medio día Aptitud para principiantes 25/100
microsoft/playwright#43484 ·
Los mantenedores suelen responder en 1 día
-
[Bug]: Python sync API logs CancelledError when exiting sync_playwright() with an unanswered routePosiblemente ocupada @yury-s la tomó hoy. Abierto
Dificultad 2/5 Menos de una hora Aptitud para principiantes 18/100
microsoft/playwright#43463 ·
Los mantenedores suelen responder en 1 día
-
[Bug]: macOS WebKit reports `dropEffect: 'copy'` on dragend for `copyMove` when the drop target doesn't set `dropEffect`Posiblemente ocupada @yury-s la tomó hoy. Abiertobrowser-webkit v1.65
microsoft/playwright#43447 · 3 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de microsoft/playwright
Issues similares
-
bug engine
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
frostney/GocciaScript#1746 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
agilepathway/label-checker#739 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
-
Wrong key location at startupAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 68/100
CopilotKit/OpenBot#800 ·
Los mantenedores suelen responder en 1 día
-
Endpoint links in the tag operations list are below the 24px target sizePosiblemente ocupada @AdzerKI la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
ehmpathy/rhachet-roles-bhuild#471 ·
Los mantenedores suelen responder en 1 día