Skip to content

refactor: Replace magic number 229 with ANDROID_IME_KEYCODE constant in BrowserInvisibleTextBoxViewExtension - #22804

Merged
MartinZikmund merged 2 commits into
dev/mazi/backspacewasmfixfrom
copilot/sub-pr-22793
Mar 9, 2026
Merged

MartinZikmund merged 2 commits into
dev/mazi/backspacewasmfixfrom
copilot/sub-pr-22793

Conversation

Copilot AI commented Mar 9, 2026 •

Copy link
Copy Markdown
Contributor

The Android IME keycode 229 was used as a bare magic number in both the keydown and keyup handlers of BrowserInvisibleTextBoxViewExtension.ts, making intent unclear and risking inconsistency if the value ever needs updating.

PR Type:

🔄 Refactoring (no functional changes, no api changes)

What is the current behavior? 🤔

229 appears as a literal in two separate event handlers with no indication of what it represents.

What is the new behavior? 🚀

Introduced private static readonly ANDROID_IME_KEYCODE = 229 alongside the other class-level constants. Both handler sites now reference this named constant:

// Before
if (ev.keyCode === 229) { ... }

// After
if (ev.keyCode === BrowserInvisibleTextBoxViewExtension.ANDROID_IME_KEYCODE) { ... }

PR Checklist ✅

Please check if your PR fulfills the following requirements:

Other information ℹ️

Follow-up to #22793 — addresses reviewer feedback on named constants.

Note: No related issue (Internal maintenance / Approved by Team member: @MartinZikmund).


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copilot AI changed the title [WIP] Update Backspace handling implementation based on feedback refactor: Replace magic number 229 with ANDROID_IME_KEYCODE constant in BrowserInvisibleTextBoxViewExtension Mar 9, 2026
@github-actions github-actions Bot added the platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform label Mar 9, 2026
@MartinZikmund
MartinZikmund marked this pull request as ready for review March 9, 2026 14:02
@MartinZikmund
MartinZikmund merged commit 2fad64e into dev/mazi/backspacewasmfix Mar 9, 2026
6 checks passed
@MartinZikmund
MartinZikmund deleted the copilot/sub-pr-22793 branch March 9, 2026 14:02
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators May 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants