-
-
Notifications
You must be signed in to change notification settings - Fork 346
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: Attachments FileList scroll button is not shown #556
Conversation
…should be displayed when `items` change.
📝 Walkthrough""" Walkthrough本次变更修改了 FileList 组件中的 Changes
Sequence Diagram(s)sequenceDiagram
participant FileList as FileList组件
participant useEffect as useEffect钩子
participant checkPing as checkPing函数
FileList->>useEffect: 检测到 overflow 或 items.length 变化
useEffect->>checkPing: 执行 checkPing()
Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
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 (
|
WalkthroughThis pull request addresses an issue where the scroll button in the Attachments FileList was not displayed correctly after adding files. The fix involves modifying the dependency array of a Changes
|
@@ -77,7 +77,7 @@ export default function FileList(props: FileListProps) { | |||
|
|||
React.useEffect(() => { | |||
checkPing(); | |||
}, [overflow]); | |||
}, [overflow, items]); |
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.
The dependency array for useEffect
has been updated to include items
. This change ensures that the effect re-runs when items
change, which is crucial for correctly displaying the scroll button when files are added.
… the entire items array Co-authored-by: afc163 <afc163@gmail.com>
Bundle ReportBundle size has no change ✅ |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #556 +/- ##
=======================================
Coverage 91.79% 91.79%
=======================================
Files 67 67
Lines 1463 1463
Branches 371 371
=======================================
Hits 1343 1343
Misses 120 120 ☔ View full report in Codecov by Sentry. |
问题描述
添加文件后,滚动按钮没有正确地显示出来

Summary by CodeRabbit