From 15fd20497c1bd9a5e123a5efda7d801d3f7ebd65 Mon Sep 17 00:00:00 2001 From: zhenyuWang <13641039885@163.com> Date: Wed, 29 Jun 2022 11:11:27 +0800 Subject: [PATCH] =?UTF-8?q?fix(hover):=20=E5=A4=84=E7=90=86=20touch=20mous?= =?UTF-8?q?e=20=E5=90=8C=E6=97=B6=E8=A7=A6=E5=8F=91=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/view/mixins/hover.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/core/view/mixins/hover.js b/src/core/view/mixins/hover.js index 64fa1d09a..4700fcbb6 100644 --- a/src/core/view/mixins/hover.js +++ b/src/core/view/mixins/hover.js @@ -33,7 +33,10 @@ export default { }, _hoverMousedown (evt) { - evt.preventDefault() + if (this._hoverTouch) { + return + } + this._handleHoverStart(evt) window.addEventListener('mouseup', this._hoverMouseup) }, @@ -59,6 +62,10 @@ export default { }, _hoverMouseup () { + if (!this._hoverTouch) { + return + } + this._handleHoverEnd() window.removeEventListener('mouseup', this._hoverMouseup) }, -- GitLab