-
-
Notifications
You must be signed in to change notification settings - Fork 326
fix: fix jump panel #907
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: fix jump panel #907
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Walkthrough此次修改在 Popup 组件的 React.useEffect 钩子内,更新了条件判断逻辑。现在会先检查 containerWidth 是否有定义,再与 selectorWidth 作比较,从而避免对 undefined 值进行不当比较。总体控制流程未发生改变,仅增强了防错处理。 Changes
Sequence Diagram(s)sequenceDiagram
participant Popup as Popup组件
participant UE as useEffect钩子
participant Check as 条件判断
participant Offset as 计算并设置offset
Popup->>UE: 触发useEffect
UE->>Check: 检查 containerWidth 是否定义
alt containerWidth已定义
Check->>Check: 判断 containerWidth < selectorWidth?
alt 条件满足
Check->>Offset: 计算并设置offset
else 条件不满足
Check->>UE: 无需设置offset
end
else containerWidth未定义
Check->>UE: 跳过计算offset
end
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure. 🔧 ESLint
src/PickerInput/Popup/index.tsxOops! Something went wrong! :( ESLint: 8.57.1 Error: Cannot read config file: /.eslintrc.js
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
⏰ Context from checks skipped due to timeout of 90000ms (2)
🔇 Additional comments (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 (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #907 +/- ##
=======================================
Coverage 98.67% 98.67%
=======================================
Files 64 64
Lines 2648 2648
Branches 732 732
=======================================
Hits 2613 2613
Misses 32 32
Partials 3 3 ☔ View full report in Codecov by Sentry. |
ref ant-design/ant-design#51071
修复动画态下,初始化会有位移的问题。
Summary by CodeRabbit