Repository navigation
fix(ssh): keep the IME confirmation Enter from submitting the port-forward dialog - #34315
Conversation
…rward dialog The SSH port-forward dialog renders its four fields as raw inputs inside a form with a submit button. IMEs that redispatch an unmarked Enter after compositionend therefore trigger implicit submission with the half-typed value. The pre-revert ImeEnterGuardedForm covered this form; #25480 moved the guard into shared fields but did not reach these raw inputs, and the #28609 lint rule only inspects Enter handlers, which these fields lack. Render the fields with ImeInput so the shared gesture tracker swallows the confirmation and its redispatch while ordinary Enter still submits.
|
No actionable comments were generated in the recent review.
|
ELI5
When you type Japanese, Chinese or Korean, you press Enter to confirm the word you are typing. In the SSH "Forward a port" dialog, that Enter also submitted the form, so the forward was created before you had finished typing. Now that Enter only confirms the word.
What Changed
The four text fields in the port-forward dialog (Remote Port, Local Port, Remote Host, Label) now use the existing
ImeInputfield instead of a plain<input>.ImeInputalready owns the IME confirmation Enter everywhere else in the app, so the Enter that confirms a candidate no longer reaches the form. A second, normal Enter still submits.On main, this dialog was the only
<form>in the renderer with plain text inputs, so this closes the gap for the whole class.This is @seijikohara's fix from #34126, cherry-picked with their authorship kept. This PR supersedes #34126. Thank you @seijikohara for the report and the fix.
Why
Reusing
ImeInputkeeps one IME policy across all text fields instead of adding a dialog-specific keydown guard.Linked Issue
Fixes #34124
Visual Proof
N/A: IME composition can't be driven in a hidden test window. The new test reproduces the composition, confirmation Enter and implicit submit sequence instead.
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
ssh-port-forward-dialog.ime-enter.test.tsxfails 4/4 with main's dialog and passes 4/4 with the fix.pnpm tc:web, oxlint, andpnpm check:changed(21 checks) pass on the exact head.Local run of the PR static job: everything passes except the Node 18 process-host smoke (no local Node 18; this change doesn't touch process-host). The orcad terminal smoke is skipped for this diff.
Review
Reviewed with Codex: no findings.
Agent skill upstream boundary
Notes
Renderer-only. Works the same on macOS, Linux and Windows, and for SSH and paired hosts (the dialog is client-side). Mobile has no port-forward dialog. No wire or compatibility changes.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)