fix(swipe): guard document.addEventListener in Taro env - #3514
fix(swipe): guard document.addEventListener in Taro env#3514xiaoyatong wants to merge 2 commits into
Conversation
在 Taro Android/iOS 运行时 document.addEventListener 可能不是函数, 在调用前增加环境检测,避免抛出 not a function 错误。 Co-Authored-By: Claude <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 4 included reviews per hour; 2 remain after this review. WalkthroughSwipe、Barrage、ImagePreview 和 Popover 组件在访问 ChangesTaro DOM 环境保护
Estimated code review effort: 2 (简单) | ~10 分钟 Merge Risk: ⚪ Minimal · up to The PR adds an environment guard before document.addEventListener in Taro runtimes to prevent a not-a-function error. No actionable merge-blocking risk remains after normal checks and review. Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 4 files.
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
imagepreview/barrage/popover 在 Taro Android/iOS 运行时直接访问 document API 会抛出 not a function,补充 typeof 守卫与 swipe 保持一致。 Co-Authored-By: Claude <noreply@anthropic.com>
在 Taro Android/iOS 运行时 document.addEventListener 可能不是函数, 在调用前增加环境检测,避免抛出 not a function 错误。
🤔 这个变动的性质是?
🔗 相关 Issue
💡 需求背景和解决方案
☑️ 请求合并前的自查清单
Summary by CodeRabbit