-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Bug: role="textbox" should be preserved in read-only mode #7500
Copy link
Copy link
Closed
Labels
Description
When a Lexical editor is read-only, its root <div contenteditable> drops role="textbox".
Playwright’s locator.fill() (and any API depending on the same autowait logic) rejects the element and throws:
Element is not an <input>, <textarea>, <select> or [contenteditable]
and does not have a role allowing [aria-readonly]
Every editor instance starts in this transient read-only state for a split second during initialisation, so tests frequently stumble over the error even though the editor soon becomes editable.
Lexical version: 0.30.0
Steps To Reproduce
- clone https://github.com/thorn0/lexical-repro
npm installnpm run test
The current behavior
role="textbox"is removed whilearia-readonly="true"is present.- Playwright (and assistive tech relying on ARIA roles) no longer recognises the element as a textbox, so autowait in
locator.fill()aborts with the error shown above.
The expected behavior
role="textbox" should remain on the element regardless of aria-readonly.
With both attributes (role="textbox" aria-readonly="true"), Playwright can interact or wait safely, and assistive technologies keep the correct semantic.
Impact of fix
- Severity : breaks E2E suites that use Playwright on apps built with Lexical, makes tests flaky.
- Beneficiaries : Any developers/components/tests that rely on Playwright autowait, plus users of assistive technology (WCAG recommends keeping the role and toggling only
aria-readonly).
Reactions are currently unavailable