Skip to content
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: emptyNode should not shaked when horizontal scroll #1142

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

linxianxi
Copy link
Contributor

@linxianxi linxianxi commented Jun 6, 2024

fix ant-design/ant-design#49279

虽然不会有位置上的变动,但是这样会展示一下白屏再展示 Empty,体验会好一些。

问题的本质是因为第一次 render 时无法获取到 componentWidth 并展示。componentWidth 是 ResizeObserver 监听后 setComponentWidth 上去的。

或许 ResizeObserver 改用 useLayoutEffect 监听宽度可完美解?

Copy link

vercel bot commented Jun 6, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
table ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 6, 2024 8:53am

@zombieJ
Copy link
Member

zombieJ commented Jun 6, 2024

Table 的一些时序可以合并掉。不过要重构就比较麻烦。现在如果是白屏的话,ssr 体验就比较糟糕了(我印象里header就是白的,就不太好)。

@linxianxi
Copy link
Contributor Author

这样闪一下体验更糟吧

Sign up for free to 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.

Table 可横向滚动时,空状态会闪动
2 participants