fix: use latest scroll close options - #647
Conversation
|
@nrps9909 is attempting to deploy a commit to the afc163's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review. Walkthrough
Changes滚动关闭行为
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to The change keeps the scroll listener stable while applying the latest popup trigger settings, with a regression test covering updates while the popup remains open. No actionable merge-blocking risk remains after normal checks and review. Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 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 |
Summary
alignPointprop update while the popup remains openProblem
useWatchinstalls its scroll listener while a popup is open. TheonScrollcallback passed to it was recreated on each render, but the effect intentionally does not depend on callbacks. IfalignPointchanged fromfalsetotruewhile the popup stayed open, the installed listener kept the old closure and did not close a click-triggered popup on scroll.Solution
Wrap the callback with the project's
useEventhelper. The listener keeps a stable function identity while its implementation reads the currentalignPoint,clickToHide, and trigger logic.Tests
rc-test --runInBand— 17 suites passed, 134 tests passed, 1 skippedtsc --noEmit— passedfather buildplus Less compile — ESM, CJS, declarations, and CSS passedgit diff --check— passedAI assistance disclosure: Codex was used to trace the listener lifecycle, audit open PRs and issues for overlap, implement the focused
useEventfix, and run the validation commands. The failing baseline and passing result were verified against upstream master.Summary by CodeRabbit
Bug 修复
测试