Repository navigation
fix(node): type number fields with real key presses like text fields - #388
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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, andclear:andrapid:were silently ignored.set(34, clear: :none)on a field holding12gave34. Selenium types number fields like any text field.numberjoinsTyping::TYPED_INPUTS, so it goes throughset_textwith real keys,clear:andrapid:.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.numbercase of the JSsethelper is removed, since number fields no longer reach it.Node#setspec:appends to a number field with clear: :none. It fails without the change. I also checked by hand a decimal,:backspaceon a negative, a 40-character value throughrapid:, and an empty value. TheNode#setspecs (67) and Capybara's#setandfill_inspecs (52) pass.