Fix iPadOS text selection and keyboard appearance issues#296836
Open
rewyekha wants to merge 2 commits intomicrosoft:mainfrom
Open
Fix iPadOS text selection and keyboard appearance issues#296836rewyekha wants to merge 2 commits intomicrosoft:mainfrom
rewyekha wants to merge 2 commits intomicrosoft:mainfrom
Conversation
…61958) - Fix double-tap word selection on iOS/iPadOS by dispatching gesture before focusing textarea in PointerEventHandler and TouchHandler - Move focusTextArea() call after dispatchMouse() to ensure selection is processed before focus changes - Update TouchHandler to use dispatchMouse() with tapCount for proper double-tap word selection support - Fix keyboard not appearing by keeping focus call within touch event handler (iOS requires direct user interaction to show on-screen keyboard) - Add missing newline at end of iPadShowKeyboard.css
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes critical text selection and keyboard appearance issues on iPadOS by reordering touch event handling operations to properly support double-tap word selection and ensure the on-screen keyboard appears when tapping in the editor.
Changes:
- Reordered
focusTextArea()to occur after gesture dispatch in bothPointerEventHandler.onTap()andTouchHandler.onTap()to fix keyboard appearance on iOS/iPadOS - Replaced simple
moveTo()call with fulldispatchMouse()inTouchHandler.onTap()to properly passtapCountfor double-tap word selection - Added trailing newline to iPadShowKeyboard.css (formatting fix)
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/vs/editor/browser/controller/pointerHandler.ts | Reordered operations in both PointerEventHandler and TouchHandler to dispatch gestures before focusing textarea, enabling double-tap word selection and keyboard appearance on touch devices |
| src/vs/editor/standalone/browser/iPadShowKeyboard/iPadShowKeyboard.css | Added missing newline at end of file (formatting fix) |
Author
|
@microsoft-github-policy-service agree |
Addresses code review feedback to eliminate duplication between PointerEventHandler and TouchHandler. - Moved _dispatchGesture method to MouseHandler base class - Both PointerEventHandler and TouchHandler now use inherited method - Removed NavigationCommandRevealType and MouseTargetType imports from pointerHandler.ts (now only needed in base class)
Author
|
Hi @aiday-mar, I've submitted this PR to fix issue #261958 (iPadOS text selection and keyboard issues). Would you be able to review it when you have a chance? Thank you! |
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.
Summary
Fixes #261958
Issues Fixed:
Changes Made:
src/vs/editor/browser/controller/pointerHandler.tsPointerEventHandler.onTap():
mouseDownCount: event.tapCountproperly triggers word selection whentapCount === 2TouchHandler.onTap():
moveTo()call with fulldispatchMouse()handlingmouseDownCount: event.tapCountto support double-tap word selectionfocusTextArea()to after gesture dispatchTechnical Details:
Double-tap detection: The
Gestureclass intouch.tstracks tap timing and setstapCount = 2for taps within 400ms of each otherWord selection trigger: When
mouseDownCount === 2is passed toviewController.dispatchMouse(), it calls_wordSelect()which selects the word at the cursor positioniOS keyboard requirement: iOS Safari only shows the virtual keyboard when
.focus()is called as a direct result of user touch interaction - not from programmatic calls outside of touch handlers. By keeping the focus call within the touch event handler but after gesture dispatch, both word selection and keyboard appearance work correctly.Testing:
Device/Browser affected: