Skip to content

[api review 1.65] Inert elements and content outside a modal <dialog> are hidden #43792

Closed

Description

PR #43211, Issue #36938, Issue #42967, #36947, #37137

  • keep not inert actionability check, extend it to selectOption()

  • revert inert as aria-hidden

  • remove <dialog> handling

  • Docs: Actionability is covered. Missing: a note on the role locator and aria snapshot pages that inert and non-modal content is excluded, and a decision on whether the two PLAYWRIGHT_SKIP_* env vars are supported (then document them) or temporary. Needs a prominent release-notes entry; this will change existing toHaveCount, toMatchAriaSnapshot and click behavior in apps that use modal dialogs.

Part of the 1.65 API review: #43790

Activity

  1. github-actions commented on Oct 30, 2026

    @github-actions
  2. github-actions commented on Oct 30, 2026

    @github-actions
    Contributor

    Hi, I'm the Playwright bot and I implemented the requested review changes.

    Fix proposed. The explicit inert action check remains and now covers selectOption(). Inert elements and content outside modal dialogs are no longer filtered from role locators, accessible names or ARIA snapshots. The modal-dialog detection and both temporary skip environment variables are removed.

    The changed checks failed on Linux at 1d5572d5ddfb7f3c8dfbbe19c8e97def0b2738db (1.65.0-next). With the fix, the seven affected and neighboring test files pass on Chromium, Firefox and WebKit: 848 passed, 7 skipped. Build and full lint checks also pass. Actionability docs and release notes for all four languages describe the final behavior.

    Condensed behavior check
    await page.setContent('<div inert><select><option>one</option><option>two</option></select></div>');
    await expect(page.getByRole('combobox')).toHaveCount(1);
    const error = await page.getByRole('combobox')
        .selectOption('two', { timeout: 1000 }).catch(e => e);
    expect(error.message).toContain('element is inert');
    await expect(page.locator('select')).toHaveValue('one');
    await page.locator('div').evaluate(e => e.removeAttribute('inert'));
    await page.getByRole('combobox').selectOption('two');
    await expect(page.locator('select')).toHaveValue('two');

    Existing tests also check accessible names, shadow trees, multiple modal dialogs, ARIA snapshot assertions, AI snapshot references, click retries and fill retries. Removing only the new select-option check makes its regression test fail because selection completes while the element is inert.

    Draft PR: #43804

    Triaged on Linux by the Playwright bot - agent run

  3. added a commit that references this issue on Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions