fix: keep vertically shifted popups within the visible area - #646
fix: keep vertically shifted popups within the visible area#6461328837476-hug wants to merge 1 commit into
Conversation
|
Someone 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 (简单) | ~10 minutes Merge Risk: ⚪ Minimal · up to The change keeps vertically shifted popups within the visible area without altering horizontal alignment or public APIs. Focused regression tests and normal validation pass, so no actionable merge-blocking risk remains. 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)
Warning Some tools did not complete. Review the errors below. 🔧 ESLint
ESLint install failed: private package registry requires authentication. Disable ESLint in CodeRabbit settings or use public packages. 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 |
nrps9909
left a comment
There was a problem hiding this comment.
Approved at exact head aa2160e9f1cc74e608b6de74cebe4cbd390f3d4d.
I independently checked the clamp against the existing shift transaction: it is limited to targets that still overlap the permitted vertical shift band; for a normal-height popup, the derived min/max bounds keep both edges inside the visible region, while Math.max(minOffsetY, ...) deliberately pins an oversized popup to the visible top. Targets fully beyond the band retain the existing follow-target behavior. The positive/negative placement offsets and both target positions pass in the focused 8-test flip/shift file.
I also ran the complete repository at this head: 17 suites passed with 138 tests and one existing skip. TypeScript passed; ESLint completed with 0 errors and 11 existing Hook warnings; changed-file Prettier and diff validation passed. The remaining Vercel result is fork deployment authorization, not a source failure.
This approval is scoped to the trigger geometry. As the description notes, the downstream picker placement must still enable shiftY and consume the released version before ant-design/ant-design#59115 is complete.
Related to ant-design/ant-design#59115
Problem
When there is not enough space above or below the target, a popup can remain partially outside the visible area even with
shiftYenabled. The existing shift calculation retains the vertical placement offset, which can leave a 4px overflow with the offsets used by DatePicker.Changes
Verification
npm run lintcompleted with 0 errors and 11 existing React Hook dependency warnings.git diff --checkpassed.I also tested this with a local picker patch against the Ant Design 6.6.1 source in Chromium. With a 400px viewport and an approximately 347px date panel, the panel's top position changed from -132px to 0. Single-date and range selection worked. I have not separately tested the originally reported Ant Design 5.20.0 / React 18.2.0 / Edge combination or every custom scrolling-container configuration.
Follow-up
This PR addresses the trigger part of the issue. Picker also needs to enable
shiftYin its default placements and consume the released trigger fix. The related Ant Design issue should remain open until that follow-up is complete.Summary by CodeRabbit
Bug Fixes
Tests