fix: KeyboardHelper overrides kb event listener#1583
Merged
madhavilosetty-intel merged 3 commits intomainfrom Feb 9, 2026
Merged
fix: KeyboardHelper overrides kb event listener#1583madhavilosetty-intel merged 3 commits intomainfrom
madhavilosetty-intel merged 3 commits intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Updates KeyBoardHelper to stop overwriting global document.on* handlers by registering/removing keyboard handlers via addEventListener/removeEventListener, with corresponding unit test updates.
Changes:
- Bind key handler methods once in
KeyBoardHelperconstructor for stable listener references. - Replace
document.onkeyup/onkeydown/onkeypressassignments withaddEventListenerandremoveEventListener. - Update unit tests to assert listener registration/removal behavior via Jest spies.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 9 comments.
| File | Description |
|---|---|
| src/core/Utilities/KeyboardHelper.ts | Switch keyboard hooking to event listeners and bind callbacks for correct removal. |
| src/test/keyboardhelper.spec.ts | Update tests to validate addEventListener/removeEventListener usage instead of document.on* mutation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
b592e99 to
298eeca
Compare
298eeca to
177e73a
Compare
madhavilosetty-intel
approved these changes
Feb 9, 2026
RosieAMT
pushed a commit
that referenced
this pull request
Feb 9, 2026
## [3.3.10](v3.3.9...v3.3.10) (2026-02-09) ### Bug Fixes * KeyboardHelper overrides kb event listener ([#1583](#1583)) ([15a9157](15a9157))
|
🎉 This PR is included in version 3.3.10 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
PR Checklist
What are you changing?
In KeyboardHelper, use event listener for keypress instead of overwriting the handler from the front end.
Anything the reviewer should know when reviewing this PR?
This PR is to resolve #796 issue.
How-To-Test
This issue is not reproducible on sample-web-ui frontend, so to reproduce the issue, a temporary keypress listener is implemented into sample-web-ui (the temp listener code is just for testing purpose, will not check in)
NOTE: the 'P' keypress is listened by frontend and printed on screen/webpage, 'P' key is being pressed during an active KVM session
If the there are associated PRs in other repositories, please link them here (i.e. device-management-toolkit/repo#365 )