Skip to content

Commit c96eabc

Browse files
author
Benjamin Pasero
committed
1 parent 15e5466 commit c96eabc

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

src/vs/base/browser/ui/button/button.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { Color } from 'vs/base/common/color';
1111
import { mixin } from 'vs/base/common/objects';
1212
import { Event as BaseEvent, Emitter } from 'vs/base/common/event';
1313
import { Disposable } from 'vs/base/common/lifecycle';
14-
import { Gesture } from 'vs/base/browser/touch';
14+
import { Gesture, EventType } from 'vs/base/browser/touch';
1515

1616
export interface IButtonOptions extends IButtonStyles {
1717
title?: boolean;
@@ -65,14 +65,16 @@ export class Button extends Disposable {
6565

6666
Gesture.addTarget(this._element);
6767

68-
this._register(DOM.addDisposableListener(this._element, DOM.EventType.CLICK, e => {
69-
if (!this.enabled) {
70-
DOM.EventHelper.stop(e);
71-
return;
72-
}
68+
[DOM.EventType.CLICK, EventType.Tap].forEach(eventType => {
69+
this._register(DOM.addDisposableListener(this._element, eventType, e => {
70+
if (!this.enabled) {
71+
DOM.EventHelper.stop(e);
72+
return;
73+
}
7374

74-
this._onDidClick.fire(e);
75-
}));
75+
this._onDidClick.fire(e);
76+
}));
77+
});
7678

7779
this._register(DOM.addDisposableListener(this._element, DOM.EventType.KEY_DOWN, e => {
7880
const event = new StandardKeyboardEvent(e);

0 commit comments

Comments
 (0)