Skip to content

touch event dispatchEvent error #150697

@Sherman-Chen

Description

@Sherman-Chen

Does this issue occur when all extensions are disabled?: No

  • VS Code Version:1.67.2
  • OS Version:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.64 Safari/537.36 Edg/101.0.1210.53

Steps to Reproduce:

  1. open vscode.dev
  2. press F12,switch to any mobile device
  3. open a folder
  4. focus any folder and tap the new file button in the folder that
  5. the new file will create in root not the folder which I focus selected before

I found that the touch event will dispatch in src\vs\base\browser\touch.ts,but 0 index of this.target is the header element,ant the last index of this.target is the new file button.

So the event dispatch in capture event,not bubble event.

[EventType.CLICK, TouchEventType.Tap].forEach(eventType => {
			this._register(addDisposableListener(this.header, eventType, e => {
				if (!e.defaultPrevented) {
					this.setExpanded(!this.isExpanded());
				}
			}));
		});

Above is listen event use bubble ,so the panel will refresh,and I focus the folder will lost,and create new file in the root folder.

Metadata

Metadata

Assignees

Labels

*not-reproducibleIssue cannot be reproduced by VS Code Team member as described

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions