Skip to content

[Bug]: selectOption will select disabled option elements and option elements nested in a disabled optgroup. #36376

Open
@robgramming

Description

@robgramming

Version

1.53.1

Steps to reproduce

  1. Clone this repository https://github.com/robgramming/playwright-issue
  2. Install Playwright: npm init playwright@latest
  3. Run the test: npx playwright test
  4. The test runs a local server using npx serve -p 3000
  5. Bug: The test passes, having successfully selected disabled options

Expected behavior

I expect to see the error, "element is not enabled" when trying to interact with disabled options in Playwright.

Actual behavior

The screenshot generated by Playwright shows disabled options have been selected by Playwright ("carrot" and "medium (unavailable)")

Image

Additional context

The disabled option elements are selected with force: false

Environment

System:
    OS: Windows 11 10.0.26100
    CPU: (12) x64 13th Gen Intel(R) Core(TM) i7-1355U
    Memory: 7.31 GB / 15.65 GB
  Binaries:
    Node: 22.14.0 - C:\Program Files\nodejs\node.EXE
    npm: 11.3.0 - C:\Program Files\nodejs\npm.CMD
  IDEs:
    VSCode: 1.101.0 - C:\Users\iRace\AppData\Local\Programs\Microsoft VS Code\bin\code.CMD
  npmPackages:
    @playwright/test: ^1.53.1 => 1.53.1

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