From 61770680d372087c12848a3c6710b1e5f5674d08 Mon Sep 17 00:00:00 2001 From: xiaohuoni <448627663@qq.com> Date: Fri, 29 May 2020 10:17:15 +0800 Subject: [PATCH 1/2] chore: hide on touchstart --- src/Trigger.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Trigger.tsx b/src/Trigger.tsx index 5baa283..17facfb 100644 --- a/src/Trigger.tsx +++ b/src/Trigger.tsx @@ -73,7 +73,7 @@ export default class Trigger extends React.Component { const currentDocument = this.props.getDocument!(); - this.touchOutsideHandler = addEventListener(currentDocument, 'touchend', this.onDocumentClick); + this.touchOutsideHandler = addEventListener(currentDocument, 'touchstart', this.onDocumentClick); }); } return; From 374420c30e29a6b8effbb36c78662faddad34f77 Mon Sep 17 00:00:00 2001 From: xiaohuoni <448627663@qq.com> Date: Fri, 29 May 2020 11:59:04 +0800 Subject: [PATCH 2/2] fix: test --- tests/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/index.js b/tests/index.js index dd17b9d..85a7212 100644 --- a/tests/index.js +++ b/tests/index.js @@ -519,7 +519,7 @@ describe('rmc-trigger', function main() { (next) => { const popupDomNode = trigger.triggerRef.getPopupDomNode(); expect(popupDomNode).to.be.ok(); - expect($(popupDomNode).css('opacity')).not.to.be('1'); + expect($(popupDomNode).css('opacity')).to.be('0'); next(); }, timeout(500), @@ -534,7 +534,7 @@ describe('rmc-trigger', function main() { (next) => { const popupDomNode = trigger.triggerRef.getPopupDomNode(); expect(popupDomNode).to.be.ok(); - expect($(popupDomNode).css('opacity')).not.to.be('1'); + expect($(popupDomNode).css('opacity')).to.be('1'); next(); }, timeout(1000),