-
Notifications
You must be signed in to change notification settings - Fork 263
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(avatarcropper): 修复taro下avatarCropper对象为空的错误 #2364
Conversation
Walkthrough在 Changes
Poem
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 as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## next #2364 +/- ##
==========================================
- Coverage 85.99% 85.99% -0.01%
==========================================
Files 217 217
Lines 22823 22821 -2
Branches 2539 2539
==========================================
- Hits 19626 19624 -2
Misses 3192 3192
Partials 5 5 ☔ View full report in Codecov by Sentry. |
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
Outside diff range and nitpick comments (10)
src/packages/avatarcropper/avatarcropper.taro.tsx (10)
Line range hint
298-300
: 使用可选链操作符简化代码。- if (canvasDom?.tagName !== 'CANVAS') { + if (canvasDom?.tagName !== 'CANVAS')? {
Line range hint
632-634
: 使用可选链操作符简化代码。- if (canvasDom?.tagName !== 'CANVAS') { + if (canvasDom?.tagName !== 'CANVAS')? {
Line range hint
653-654
: 使用可选链操作符简化代码。- if (canvasDom?.tagName !== 'CANVAS') { + if (canvasDom?.tagName !== 'CANVAS')? {
Line range hint
687-689
: 使用可选链操作符简化代码。- if (canvasDom?.tagName !== 'CANVAS') { + if (canvasDom?.tagName !== 'CANVAS')? {
Line range hint
696-701
: 确保使用鼠标事件的同时,也提供键盘事件,以支持键盘导航。+ onKeyUp={(_e) => action()} + onKeyDown={(_e) => action()} + onKeyPress={(_e) => action()}
Line range hint
724-724
: 确保使用鼠标事件的同时,也提供键盘事件,以支持键盘导航。+ onKeyUp={chooseImage} + onKeyDown={chooseImage} + onKeyPress={chooseImage}
Line range hint
163-163
: React Hook useEffect依赖项缺失:'canvasAll'。应该将其包含在依赖数组中。
Line range hint
177-177
: React Hook useMemo依赖项缺失:'shape'。应该将其包含在依赖数组中。
Line range hint
263-263
: React Hook useCallback依赖项缺失:'pixelRatio' 和 'space'。应该将它们包含在依赖数组中。
Line range hint
280-280
: React Hook useCallback依赖项缺失:'canvasAll.canvasId', 'state.displayHeight', 和 'state.displayWidth'。应该将它们包含在依赖数组中。
Summary by CodeRabbit
canvas
元素存在性的检查,防止在元素不存在时设置其宽度和高度。