-
Notifications
You must be signed in to change notification settings - Fork 267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(pulltorefresh): 真机体验优化 #2905
fix(pulltorefresh): 真机体验优化 #2905
Conversation
变更概述概览此次拉取请求涉及多个文件的修改,主要包括包配置、组件演示和组件实现。主要变更包括更新包名和版本、修改 Lottie 组件的环境渲染逻辑、调整 Loading 组件的属性,以及为 PullToRefresh 组件添加触摸事件处理。 变更
可能相关的 PR
建议标签
建议审阅者
诗歌
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
package.json (1)
2-3
: 包名和版本变更需同步更新文档重命名为
@dongdesign/components
并修改版本号后,需确保项目文档、README 等同步更新;若在 CI/CD 发布流水线中依赖旧包名,也需要一并更新。
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
package.json
(2 hunks)src/packages/loading/demos/taro/demo1.tsx
(1 hunks)src/packages/lottie/mp.taro.tsx
(2 hunks)src/packages/pulltorefresh/pulltorefresh.taro.tsx
(1 hunks)
🔇 Additional comments (4)
src/packages/loading/demos/taro/demo1.tsx (1)
28-28
: 注意 autoPlay
属性的兼容性
更名为 autoPlay
符合多数组件对属性大小写的约定,但请确认下游组件及第三方库对该写法的兼容性,确保不会影响动画正常播放。
src/packages/pulltorefresh/pulltorefresh.taro.tsx (1)
179-179
: 添加 catchMove
属性以优化真机下的交互体验
catchMove
能有效防止在下拉刷新时页面整体被拖动,改善在真机上的使用体验;请确保不会影响到外层滚动区域,不然可能导致与父组件的滚动冲突。
src/packages/lottie/mp.taro.tsx (2)
4-4
: 新增 getEnv
导入以判断运行环境
在 Taro 中通过 getEnv
判断环境是常见做法,可更好地兼容不同小程序平台与 H5 环境,做法合理。
85-106
: 依据不同环境切换 <canvas>
属性
通过 getEnv()
判断平台并分别使用 canvasId
或 canvas-id
,以及相应的禁止滚动属性,是适配多平台的有效方案。请注意保持兼容性测试,避免合并后在特定平台出现绘制或滚动问题。
package.json
Outdated
@@ -1,6 +1,6 @@ | |||
{ | |||
"name": "@nutui/nutui-react-taro", | |||
"version": "3.0.0-beta.10", | |||
"name": "@dongdesign/components", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个先改回去~~
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## feat_v3.x #2905 +/- ##
==========================================
Coverage 85.97% 85.97%
==========================================
Files 277 277
Lines 18692 18692
Branches 2769 2769
==========================================
Hits 16070 16070
Misses 2617 2617
Partials 5 5 ☔ View full report in Codecov by Sentry. |
不加 catchmove 的时候,拖动会出现页面一起被拉下来的情况
Summary by CodeRabbit
包名和版本更新
@nutui/nutui-react-taro
更改为@dongdesign/components
3.0.0-beta.10
降级到3.0.0-beta.0
组件优化
autoplay
更新为autoPlay
catchMove
属性,改善触摸事件处理