提交 2422b62a 编写于 作者: P Peng Lyu

Avoid mouse down and touch conflicts.

上级 2517b609
......@@ -202,7 +202,7 @@ export class PointerEventHandler extends MouseHandler {
this._lastPointerType = 'mouse';
this.viewHelper.linesContentDomNode.addEventListener('pointerdown', (e: any) => {
this._register(dom.addDisposableListener(this.viewHelper.linesContentDomNode, 'pointerdown', (e: any) => {
const pointerType = <any>e.pointerType;
if (pointerType === 'mouse') {
this._lastPointerType = 'mouse';
......@@ -212,7 +212,7 @@ export class PointerEventHandler extends MouseHandler {
} else {
this._lastPointerType = 'pen';
}
});
}));
// PonterEvents
const pointerEvents = new EditorPointerEventFactory(this.viewHelper.viewDomNode);
......@@ -256,9 +256,11 @@ export class PointerEventHandler extends MouseHandler {
}
public _onMouseDown(e: EditorMouseEvent): void {
if (this._lastPointerType !== 'touch') {
super._onMouseDown(e);
if (e.target && this.viewHelper.linesContentDomNode.contains(e.target) && this._lastPointerType === 'touch') {
return;
}
super._onMouseDown(e);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册