-
Notifications
You must be signed in to change notification settings - Fork 273
fix(noticebar): first item is not visible when scrolling vertically #3249
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
base: feat_v3.x
Are you sure you want to change the base?
Conversation
Walkthrough本次更改调整了 NoticeBar 组件中垂直滚动容器的高度计算方式。原本高度为单项高度与子元素数量的乘积,现将高度增加一个单项高度,变为单项高度乘以(子元素数量加一),以支持更流畅的滚动效果。新增了对应的测试用例验证此高度计算。其他逻辑未作更改。 Changes
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
🧰 Additional context used🧬 Code Graph Analysis (1)src/packages/noticebar/__test__/noticebar.spec.tsx (1)
⏰ Context from checks skipped due to timeout of 90000ms (1)
🔇 Additional comments (1)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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 (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## feat_v3.x #3249 +/- ##
=============================================
+ Coverage 87.59% 87.90% +0.31%
=============================================
Files 290 290
Lines 19102 19102
Branches 2930 2950 +20
=============================================
+ Hits 16732 16792 +60
+ Misses 2365 2305 -60
Partials 5 5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/packages/noticebar/noticebar.taro.tsx
(1 hunks)src/packages/noticebar/noticebar.tsx
(1 hunks)
🧰 Additional context used
🪛 GitHub Check: codecov/patch
src/packages/noticebar/noticebar.tsx
[warning] 356-356: src/packages/noticebar/noticebar.tsx#L356
Added line #L356 was not covered by tests
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: test
- GitHub Check: build
🔇 Additional comments (1)
src/packages/noticebar/noticebar.taro.tsx (1)
361-361
: 与 React 版本保持一致的正确修复Taro 版本的修改与 React 版本完全一致,确保了跨平台行为的统一性。高度计算的调整
(childCount + 1)
正确地为垂直无限滚动提供了额外的容器空间,解决了第一项在滚动过程中不可见的问题。
61d266a
to
ce7517f
Compare
🤔 这个变动的性质是?
🔗 相关 Issue
#1893
💡 需求背景和解决方案
复现步骤:
官方文档的Demo中即可复现:NoticeBar 纵向模式:自定义滚动内容
解决方案:
代码中实现无限轮播是通过垂直偏移容器与第一项内容来实现的,但是这里忽略了一个点:当偏移第一项时,其实它已经不在容器中了,虽然在整个视图中它的位置是对的,但并不可见。
可以给容器加一列高度来处理第一项的偏移
☑️ 请求合并前的自查清单
Summary by CodeRabbit