Skip to content

fix(input): select empty-value options by text - #2501

Merged
Lightning00Blade merged 1 commit into
ChromeDevTools:mainfrom
Iams4kura:bugfix/select-empty-option-value-20260808t001432z
Aug 10, 2026
Merged

fix(input): select empty-value options by text#2501
Lightning00Blade merged 1 commit into
ChromeDevTools:mainfrom
Iams4kura:bugfix/select-empty-option-value-20260808t001432z

Conversation

@Iams4kura

Copy link
Copy Markdown
Contributor

Summary

  • Fixes: When fill targets a native select option whose visible text matches the requested value but whose DOM value is the empty string, the tool reports success while the previously selected option remains selected.
  • Root cause: selectOption tests the option's DOM value for truthiness before calling Locator.fill. An empty string is a valid option value, but the truthiness check skips the fill while optionFound remains true, so the handler returns a false success.

Regression evidence

  • Before: npx --yes -p node@24 -c 'node --version && npm run test tests/tools/input.test.ts -- --test-name-pattern=empty.value.by.text' exited 1

  • After: npx --yes -p node@24 -c 'node --version && npm run test tests/tools/input.test.ts -- --test-name-pattern=empty.value.by.text' exited 0

Verification

  • npx --yes -p node@24 -c 'node --version && npm run test tests/tools/input.test.ts'
  • npx --yes -p node@24 -c 'node --version && npm run build'
  • npx --yes -p node@24 -c 'node --version && npm run check-format'
  • npx --yes -p node@24 -c 'node --version && npm run gen'

The full npm run test was also attempted. On this machine it reaches an
unrelated Chrome 151 Page.captureScreenshot: Page is too large failure; the
same screenshot test fails identically on the exact unmodified base SHA under
Node 24. The complete affected input test suite passes.

Scope

  • 2 files changed, +40 / -2 lines

@google-cla

google-cla Bot commented Aug 8, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@Lightning00Blade
Lightning00Blade self-requested a review August 10, 2026 10:40

@Lightning00Blade Lightning00Blade left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@Lightning00Blade
Lightning00Blade added this pull request to the merge queue Aug 10, 2026
Merged via the queue into ChromeDevTools:main with commit b969c45 Aug 10, 2026
26 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants