Fix duplicated character input in press_key#421
Open
monir600p-blip wants to merge 1 commit into
Open
Conversation
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.
Summary
Fix duplicated text entry for printable single-character keys in
press_key().Problem
press_key()was sending printable characters twice:Input.dispatchKeyEventwithtype="keyDown"andtext=...Input.dispatchKeyEventwithtype="char"That caused helpers like
fill_input(...)to duplicate every typed character.Fix
Only send
textonkeyDownfor non-single-character cases.Printable single-character input is now inserted by the
charevent only.Verification
Verified locally with
browser-harnessagainst a real Chrome session:fill_input(...)now writes normal text without duplicationhttps://httpbin.org/forms/postwere filled correctlySummary by cubic
Fix duplicated character input in
press_key()by sending printable single-character input via thecharevent only. Prevents double characters in helpers likefill_input(...)and normal form entry.textonkeyDownfor single printable keys; keepcharevent for insertion. Multi-character cases still sendtextonkeyDown.browser-harnessin Chrome: inputs no longer duplicate; navigation and page reading remain unaffected.Written for commit ecd1037. Summary will update on new commits.