fix(mobile): take-control tap leaks to xterm on iOS, opens keyboard#90
Merged
Conversation
…rd popup) On iOS the take-control button is rendered inside .viewer-overlay, a sibling of .term. Between touchstart and the synthesized click event a sub-100ms relay roundtrip can flip isDriver and remove the overlay; iOS then redirects the resulting click to whatever sits under the touch point — xterm — focusing its hidden helper textarea and popping up the on-screen keyboard. The take-control click effectively never fires. Make .term pointer-events: none while !isDriver so a tap can only ever land on the overlay button. Also pin button type="button" + @click.stop as defense in depth.
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.
Repro
On iOS, when the desktop is the active driver and the phone is viewing, the mobile view shows a "远端正在控制 / 接管控制" overlay. Tapping "接管控制" doesn't take control — the on-screen keyboard pops up instead and the overlay stays visible.
Root cause
The take-control button is inside `.viewer-overlay`, a sibling of `.term`. xterm hosts a hidden `<textarea>` (the helper textarea for IME) inside `.term`. On a fast (LAN) relay the sub-100ms roundtrip from `claim_driver` to the broadcast driver-change can land between iOS's `touchstart` and the synthesized click event:
Even when the click does hit the button correctly, the same shape of redirection can mis-fire if the underlying element changes mid-touch.
Fix
Set `.term { pointer-events: none }` whenever `!isDriver`, so the only interactive surface under the touch is the overlay itself. The button can fire its click reliably; the xterm textarea is never reachable while the overlay is up.
Defense-in-depth on the button:
Test plan