Dispatch GestureEvent in node depth order #200612
Merged
+15
−2
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
TAP
theNew Folder
icon in the file tree, the folder would be created in root directory instead of the opened folder:However, the
CLICK
behavior works as expected: a new folder is created within the selected directory. This discrepancy arises because when you tap, thePaneView
receives the event prior toNew Folder
, which set the current focus node to the pane header before creating folder/file.Current behavior
Currently
GestureEvent
s 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.target
corresponds to insertion order of theLinkedList
:vscode/src/vs/base/browser/touch.ts
Line 110 in 3648016