-
-
Notifications
You must be signed in to change notification settings - Fork 607
fix: emptyNode should not shaked when horizontal scroll #1142
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Table 的一些时序可以合并掉。不过要重构就比较麻烦。现在如果是白屏的话,ssr 体验就比较糟糕了(我印象里header就是白的,就不太好)。 |
这样闪一下体验更糟吧 |
冲突解决一下我合并 |
67cc908
to
7bdc9ca
Compare
@linxianxi is attempting to deploy a commit to the React Component Team on Vercel. A member of the Team first needs to authorize it. |
Walkthrough本次更改在 Changes
Sequence Diagram(s)sequenceDiagram
participant Parent
participant ExpandedRow
Parent->>ExpandedRow: 渲染组件,传递 isEmpty、horizonScroll、componentWidth 等属性
ExpandedRow->>ExpandedRow: 判断 isEmpty && horizonScroll && !componentWidth
alt 条件成立
ExpandedRow->>ExpandedRow: 设置 visibility: 'hidden'
else 条件不成立
ExpandedRow->>ExpandedRow: visibility 不变
end
ExpandedRow->>Parent: 渲染结果
Assessment against linked issues
Suggested reviewers
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/Body/ExpandedRow.tsxOops! Something went wrong! :( ESLint: 8.57.1 ESLint couldn't find the config "prettier" to extend from. Please check that the name of the config is correct. The config "prettier" was referenced from the config file in "/.eslintrc.js". If you still have problems, please stop by https://eslint.org/chat/help to chat with the team. Tip ⚡️ Faster reviews with caching
Enjoy the performance boost—your workflow just got faster. ✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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 (
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (2)
src/Body/ExpandedRow.tsx (2)
64-64
: 细化注释以增加可读性和上下文
当前注释仅提供了 Issue 链接,建议补充描述性文字,说明为何在此处需要隐藏元素,以便在离线阅读或后续维护时能快速了解本行变更的意图。
65-65
: 验证 SSR 场景下的表现及优化样式定义
新增的visibility
控制依赖于isEmpty && horizonScroll && !componentWidth
,请确认在服务端渲染(SSR)环境中horizonScroll
和componentWidth
的默认值,避免出现意外的内容隐藏或白屏闪烁。此外,为了与 React 对style
属性的惯例保持一致,建议将null
替换为undefined
,从而保证在不需要时该属性不会被注入到最终的 DOM。
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
tests/__snapshots__/FixedColumn.spec.tsx.snap
is excluded by!**/*.snap
📒 Files selected for processing (1)
src/Body/ExpandedRow.tsx
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: test / react component workflow
fix ant-design/ant-design#49279
虽然不会有位置上的变动,但是这样会展示一下白屏再展示 Empty,体验会好一些。
问题的本质是因为第一次 render 时无法获取到 componentWidth 并展示。componentWidth 是 ResizeObserver 监听后还通过 getContainerWidth 然后 setComponentWidth 上去的。这个 pr 还无法完美解决
Summary by CodeRabbit