Skip to content

Commit 5d3254c

Browse files
authored
Run / Play Button Can't Be Clicked By Touch on Touchscreen (fix microsoft#251958) (microsoft#259755)
1 parent 9ace93e commit 5d3254c

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/vs/workbench/contrib/debug/browser/debugActionViewItems.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import { AccessibilityVerbositySettingId } from '../../accessibility/browser/acc
2828
import { AccessibilityCommandId } from '../../accessibility/common/accessibilityCommands.js';
2929
import { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js';
3030
import { hasNativeContextMenu } from '../../../../platform/window/common/window.js';
31+
import { Gesture, EventType as TouchEventType } from '../../../../base/browser/touch.js';
3132

3233
const $ = dom.$;
3334

@@ -87,12 +88,15 @@ export class StartDebugActionViewItem extends BaseActionViewItem {
8788
this.start.setAttribute('role', 'button');
8889
this._setAriaLabel(title);
8990

90-
this.toDispose.push(dom.addDisposableListener(this.start, dom.EventType.CLICK, () => {
91-
this.start.blur();
92-
if (this.debugService.state !== State.Initializing) {
93-
this.actionRunner.run(this.action, this.context);
94-
}
95-
}));
91+
this._register(Gesture.addTarget(this.start));
92+
for (const event of [dom.EventType.CLICK, TouchEventType.Tap]) {
93+
this.toDispose.push(dom.addDisposableListener(this.start, event, () => {
94+
this.start.blur();
95+
if (this.debugService.state !== State.Initializing) {
96+
this.actionRunner.run(this.action, this.context);
97+
}
98+
}));
99+
}
96100

97101
this.toDispose.push(dom.addDisposableListener(this.start, dom.EventType.MOUSE_DOWN, (e: MouseEvent) => {
98102
if (this.action.enabled && e.button === 0) {

0 commit comments

Comments
 (0)