Skip to content

fix(align): restore overflowX and overflowY after force align - #615

Merged
zombieJ merged 1 commit into
react-component:masterfrom
ffgenius:overflow
Jun 1, 2026
Merged

fix(align): restore overflowX and overflowY after force align#615
zombieJ merged 1 commit into
react-component:masterfrom
ffgenius:overflow

Conversation

@ffgenius

@ffgeniusffgenius commented Apr 12, 2026

Copy link
Copy Markdown
Contributor

solve ant-design/ant-design#57665

Summary by CodeRabbit

发布说明

  • Bug 修复

    • 改进弹出窗口对齐过程,确保正确保持和恢复溢出样式设置
  • 测试

    • 添加测试用例,验证对齐过程中溢出样式的保持一致性

@coderabbitai

coderabbitaiBot commented Apr 12, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 24fc0314-361c-4de3-8f1e-4edf8064647b

📥 Commits

Reviewing files that changed from the base of the PR and between 59b659d and e22c60b.

📒 Files selected for processing (2)
  • src/hooks/useAlign.ts
  • tests/align.test.tsx

Walkthrough

useAlign 钩子现在会在临时隐藏弹出元素进行对齐计算时,捕获并恢复其 overflowXoverflowY 样式属性,确保对齐完成后这些样式值被正确还原。新增测试用例验证此行为。

Changes

Cohort / File(s)Summary
Hook 改动
src/hooks/useAlign.ts
在对齐计算前读取 overflowXoverflowY 样式值,计算完成后恢复这些值以保持原始溢出样式配置。
测试验证
tests/align.test.tsx
新增测试用例验证弹出元素在重新对齐后,overflowXoverflowY 样式值能够被正确保留。

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • afc163
  • zombieJ

Poem

🐰 一只兔子的颂歌

样式之流,我来守护,
溢出的秘密已收妥善,
对齐重来,衣裳依旧,
测试见证,变化无悔。
小修小补,大爱无声 ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check nameStatusExplanationResolution
Docstring Coverage⚠️ WarningDocstring coverage is 0.00% which is insufficient. The required threshold is 80.00%.Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ Passed标题准确地总结了主要变更,清晰地反映了修复的核心内容。

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assistgemini-code-assistBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the useAlign hook to capture and restore overflowX and overflowY styles, preventing them from being lost during alignment. It also includes a test case to confirm the fix. A review comment suggests removing an unnecessary empty line to maintain consistent code formatting.

Comment threadsrc/hooks/useAlign.ts
const originOverflow = popupElement.style.overflow;
const originOverflowX = popupElement.style.overflowX;
const originOverflowY = popupElement.style.overflowY;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This extra empty line is redundant and deviates from the existing code style in this file. It's recommended to remove it to keep the code clean and maintain consistent spacing.

@codecov

codecovBot commented Apr 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.28%. Comparing base (59b659d) to head (e22c60b).

Additional details and impacted files
@@ Coverage Diff @@## master #615 +/- ##
==========================================
+ Coverage 97.26% 97.28% +0.01% 
==========================================
Files 17 17 Lines 952 956 +4 Branches 274 278 +4 ==========================================
+ Hits 926 930 +4 
Misses 26 26 

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@zombieJ
zombieJ merged commit 614fd4b into react-component:masterJun 1, 2026
9 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@ffgenius@zombieJ@MadCcc