From e86b383d2cc7824afc4c396ab24e06b1072d9d76 Mon Sep 17 00:00:00 2001 From: yuyuyzl Date: Tue, 12 Nov 2024 17:19:20 +0800 Subject: [PATCH 1/3] fix: screenY is undefined --- packages/bui-utils/src/touchBlocker.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/bui-utils/src/touchBlocker.ts b/packages/bui-utils/src/touchBlocker.ts index ca9d0705..e40ed764 100644 --- a/packages/bui-utils/src/touchBlocker.ts +++ b/packages/bui-utils/src/touchBlocker.ts @@ -55,6 +55,8 @@ export default function blockTouch(root) { }; const onTouchMove = (e) => { const currentTouch = e.touches[0]; + // 如果单指在滑动的时候另一只手指碰到屏幕一次而滑动手指不放开,就会触发touchend清空lastTouch引发这个问题 + if (!lastTouch || !currentTouch) return; if (!moveAxis) { if ( Math.abs(lastTouch.screenY - currentTouch.screenY) > @@ -81,7 +83,8 @@ export default function blockTouch(root) { e.preventDefault(); // setLastTouch(e.touches[0]); }; - const onTouchEnd = () => { + const onTouchEnd = (e) => { + if (e.touches.length !== 0) return; lastTouch = undefined; moveDirection = undefined; moveAxis = undefined; From 15a86de0aaee7654764ee98dad7506b3e1fb7861 Mon Sep 17 00:00:00 2001 From: yuyuyzl Date: Tue, 12 Nov 2024 17:37:06 +0800 Subject: [PATCH 2/3] fix: screenY is undefined --- packages/bui-utils/src/touchBlocker.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/bui-utils/src/touchBlocker.ts b/packages/bui-utils/src/touchBlocker.ts index ca9d0705..e40ed764 100644 --- a/packages/bui-utils/src/touchBlocker.ts +++ b/packages/bui-utils/src/touchBlocker.ts @@ -55,6 +55,8 @@ export default function blockTouch(root) { }; const onTouchMove = (e) => { const currentTouch = e.touches[0]; + // 如果单指在滑动的时候另一只手指碰到屏幕一次而滑动手指不放开,就会触发touchend清空lastTouch引发这个问题 + if (!lastTouch || !currentTouch) return; if (!moveAxis) { if ( Math.abs(lastTouch.screenY - currentTouch.screenY) > @@ -81,7 +83,8 @@ export default function blockTouch(root) { e.preventDefault(); // setLastTouch(e.touches[0]); }; - const onTouchEnd = () => { + const onTouchEnd = (e) => { + if (e.touches.length !== 0) return; lastTouch = undefined; moveDirection = undefined; moveAxis = undefined; From 77427230338235904698a4acab5fd3ff6bb183c1 Mon Sep 17 00:00:00 2001 From: yuyuyzl Date: Tue, 12 Nov 2024 17:40:59 +0800 Subject: [PATCH 3/3] Publish --- lerna.json | 2 +- packages/bui-core/package.json | 2 +- packages/bui-icons/package.json | 2 +- packages/bui-styles/package.json | 2 +- packages/bui-types/package.json | 2 +- packages/bui-utils/package.json | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lerna.json b/lerna.json index 539138a1..409a471c 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.3.0", + "version": "1.3.1", "npmClient": "pnpm", "packages": ["packages/*"], "command": { diff --git a/packages/bui-core/package.json b/packages/bui-core/package.json index 0586ac3c..d62b5375 100644 --- a/packages/bui-core/package.json +++ b/packages/bui-core/package.json @@ -1,6 +1,6 @@ { "name": "@bifrostui/react", - "version": "1.3.0", + "version": "1.3.1", "description": "React components for building mobile application", "homepage": "http://bui.taopiaopiao.com", "license": "MIT", diff --git a/packages/bui-icons/package.json b/packages/bui-icons/package.json index 304d4ae7..10768f8a 100644 --- a/packages/bui-icons/package.json +++ b/packages/bui-icons/package.json @@ -1,6 +1,6 @@ { "name": "@bifrostui/icons", - "version": "1.3.0", + "version": "1.3.1", "description": "SVG icon components for BUI", "homepage": "http://bui.taopiaopiao.com", "license": "MIT", diff --git a/packages/bui-styles/package.json b/packages/bui-styles/package.json index 83be298e..f3271321 100644 --- a/packages/bui-styles/package.json +++ b/packages/bui-styles/package.json @@ -1,6 +1,6 @@ { "name": "@bifrostui/styles", - "version": "1.3.0", + "version": "1.3.1", "description": "Common style definitions for BUI React components", "homepage": "http://bui.taopiaopiao.com", "license": "MIT", diff --git a/packages/bui-types/package.json b/packages/bui-types/package.json index 5d7c57e4..8fd52ac9 100644 --- a/packages/bui-types/package.json +++ b/packages/bui-types/package.json @@ -1,6 +1,6 @@ { "name": "@bifrostui/types", - "version": "1.3.0", + "version": "1.3.1", "description": "Utility types for BUI", "typings": "src/index.ts", "files": [ diff --git a/packages/bui-utils/package.json b/packages/bui-utils/package.json index e9b1d2a9..6e7b0cb6 100644 --- a/packages/bui-utils/package.json +++ b/packages/bui-utils/package.json @@ -1,6 +1,6 @@ { "name": "@bifrostui/utils", - "version": "1.3.0", + "version": "1.3.1", "description": "BUI React utilities for building components.", "main": "src/index.ts", "module": "src/index.ts",