Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: webContents.sendInputEvent does not work with Space and Enter #39610

Closed
3 tasks done
tristanmercille opened this issue Aug 22, 2023 · 5 comments · Fixed by #39776
Closed
3 tasks done

[Bug]: webContents.sendInputEvent does not work with Space and Enter #39610

tristanmercille opened this issue Aug 22, 2023 · 5 comments · Fixed by #39776
Assignees
Labels
26-x-y 27-x-y bug 🪲 has-repro-gist Issue can be reproduced with code at https://gist.github.com/ platform/all status/confirmed A maintainer reproduced the bug or agreed with the feature

Comments

@tristanmercille
Copy link

Preflight Checklist

Electron Version

19.0.9

What operating system are you using?

Ubuntu

Operating System Version

20.04

What arch are you using?

x64

Last Known Working Electron version

No response

Expected Behavior

webContents.sendInputEvent({ keyCode: "Space", type: "keyDown" });
webContents.sendInputEvent({ keyCode: "Space", type: "char" });
webContents.sendInputEvent({ keyCode: "Space", type: "keyUp" });

Displays "Spa" in my input field.
Same applies for "Enter", which displays "Ent".

Backspace and other simple letters work fine.

Actual Behavior

"Space" and "Enter" keycodes input the first 3 letters instead of the actual key.

Testcase Gist URL

No response

Additional Information

No response

@tristanmercille tristanmercille changed the title [Bug]: sendInputEvent does not work with Space and Enter [Bug]: webContents.sendInputEvent does not work with Space and Enter Aug 22, 2023
@tristanmercille
Copy link
Author

Same as this issue: #24279, which was closed because of invalid formatting.

@codebytere codebytere added the blocked/need-repro Needs a test case to reproduce the bug label Aug 22, 2023
@github-actions
Copy link
Contributor

Hello @tristanmercille. Thanks for reporting this and helping to make Electron better!

Would it be possible for you to make a standalone testcase with only the code necessary to reproduce the issue? For example, Electron Fiddle is a great tool for making small test cases and makes it easy to publish your test case to a gist that Electron maintainers can use.

Stand-alone test cases make fixing issues go more smoothly: it ensure everyone's looking at the same issue, it removes all unnecessary variables from the equation, and it can also provide the basis for automated regression tests.

Now adding the blocked/need-repro Needs a test case to reproduce the bug label for this reason. After you make a test case, please link to it in a followup comment. This issue will be closed in 10 days if the above is not addressed.

@tristanmercille
Copy link
Author

tristanmercille commented Aug 24, 2023

Here's a link to the gist for reproduction: https://gist.github.com/tristanmercille/ec40d0ef8ce2da99da52a464b74f8d70

When the app is ran, it should type a space (" ") into the input field every second. Instead, we see the chars "Spa".

@github-actions github-actions bot removed the blocked/need-repro Needs a test case to reproduce the bug label Aug 24, 2023
@wugaosheng123
Copy link
Contributor

bump

@tristanmercille
Copy link
Author

Bug also reproduces on Electron 26.1.0 and 27.0.0-alpha.4.

@codebytere codebytere added platform/all status/confirmed A maintainer reproduced the bug or agreed with the feature has-repro-gist Issue can be reproduced with code at https://gist.github.com/ 26-x-y 27-x-y blocked/need-info ❌ Cannot proceed without more information and removed status/confirmed A maintainer reproduced the bug or agreed with the feature labels Sep 7, 2023
@codebytere codebytere self-assigned this Sep 7, 2023
@codebytere codebytere added status/confirmed A maintainer reproduced the bug or agreed with the feature and removed blocked/need-info ❌ Cannot proceed without more information labels Sep 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
26-x-y 27-x-y bug 🪲 has-repro-gist Issue can be reproduced with code at https://gist.github.com/ platform/all status/confirmed A maintainer reproduced the bug or agreed with the feature
Projects
No open projects
Status: 👀 Unsorted Items
Status: 🛠️ Fixed for Next Release
Development

Successfully merging a pull request may close this issue.

3 participants