Skip to content

fix(node): type number fields with real key presses like text fields - #388

Merged
route merged 2 commits into
mainfrom
fix/number-input-typing
Nov 25, 2026
Merged

route merged 2 commits into
mainfrom
fix/number-input-typing

Conversation

@route

@route route commented Nov 25, 2026

Copy link
Copy Markdown
Member

Follows #377 and #378, which made text fields use real key presses and added clear:. input[type=number] was left out: its value was set from JS, so it got no key events, and clear: and rapid: were silently ignored. set(34, clear: :none) on a field holding 12 gave 34. Selenium types number fields like any text field.

  • number joins Typing::TYPED_INPUTS, so it goes through set_text with real keys, clear: and rapid:.
  • Number fields don't support setSelectionRange. clear: moves the caret with End, the same path feat(node): support clear: in set and warn about unsupported options #378 uses for email fields.
  • The number case of the JS set helper is removed, since number fields no longer reach it.
  • New Node#set spec: appends to a number field with clear: :none. It fails without the change. I also checked by hand a decimal, :backspace on a negative, a 40-character value through rapid:, and an empty value. The Node#set specs (67) and Capybara's #set and fill_in specs (52) pass.
  • CHANGELOG line under Fixed.

A number field's value was set from JS, with no key events, and clear: and rapid: were ignored without a warning. Number
joins the typed inputs, as Selenium types it, and the number branch of the JS set helper goes away.
@route
route merged commit 0583e5e into main Nov 25, 2026
5 of 6 checks passed
@route
route deleted the fix/number-input-typing branch November 25, 2026 11:56
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.

1 participant