Dispatch GestureEvent in node depth order#200612
Merged
alexdima merged 2 commits intomicrosoft:mainfrom Mar 15, 2024
Merged
Conversation
GestureEvent in node depth orderGestureEvent in node depth order
GestureEvent in node depth order
Member
|
@mjbvz blame points to you as the initial author so assigning you... let me know if you want me to help from the testing perspective as I have an iPad. |
chrmarti
approved these changes
Mar 15, 2024
chen-ky
pushed a commit
to chen-ky/vscode
that referenced
this pull request
Mar 18, 2024
Dispatching `GestureEvent` in node depth order Co-authored-by: Alexandru Dima <alexdima@microsoft.com>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
This PR changes the order to follow the node depth order, emulating the sequence of event bubbling. It fixes some touch inconsistent compared to click events we found when using touchscreen devices like iPad. For example, if you
TAPtheNew Foldericon in the file tree, the folder would be created in root directory instead of the opened folder:However, the
CLICKbehavior works as expected: a new folder is created within the selected directory. This discrepancy arises because when you tap, thePaneViewreceives the event prior toNew Folder, which set the current focus node to the pane header before creating folder/file.Current behavior
Currently
GestureEvents are dispatched according to the order ofthis.targets:vscode/src/vs/base/browser/touch.ts
Lines 277 to 282 in 3648016
The order of
this.targetcorresponds to insertion order of theLinkedList:vscode/src/vs/base/browser/touch.ts
Line 110 in 3648016