Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dispatch GestureEvent in node depth order #200612

Merged
merged 2 commits into from Mar 15, 2024

Conversation

Yesterday17
Copy link
Contributor

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 the New Folder icon in the file tree, the folder would be created in root directory instead of the opened folder:

20231212151914_rec_

However, the CLICK behavior works as expected: a new folder is created within the selected directory. This discrepancy arises because when you tap, the PaneView receives the event prior to New 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 of this.targets:

for (const target of this.targets) {
if (target.contains(event.initialTarget)) {
target.dispatchEvent(event);
this.dispatched = true;
}
}

The order of this.target corresponds to insertion order of the LinkedList:

const remove = Gesture.INSTANCE.targets.push(element);

@Yesterday17 Yesterday17 changed the title Dispatching GestureEvent in node depth order Dispatch GestureEvent in node depth order Dec 12, 2023
@Yesterday17 Yesterday17 changed the title Dispatch GestureEvent in node depth order Dispatch GestureEvent in node depth order Dec 12, 2023
@lramos15 lramos15 assigned TylerLeonhardt and unassigned lramos15 Dec 12, 2023
@TylerLeonhardt
Copy link
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.

@mjbvz mjbvz assigned alexdima and unassigned mjbvz Jan 9, 2024
Copy link
Member

@alexdima alexdima left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@alexdima alexdima enabled auto-merge (squash) March 15, 2024 16:46
@alexdima alexdima added this to the March 2024 milestone Mar 15, 2024
@alexdima alexdima merged commit 9f1264d into microsoft:main Mar 15, 2024
6 checks passed
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants