8000 数据在更新之后列表高度没有刷新 · Issue #974 · uiwjs/uiw · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

数据在更新之后列表高度没有刷新 #974

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

Closed
58bcbedf47bd91439c opened this issue Nov 8, 2023 · 8 comments
Closed

数据在更新之后列表高度没有刷新 #974

58bcbedf47bd91439c opened this issue Nov 8, 2023 · 8 comments
< 8000 h2 class="sr-only">Comments
@58bcbedf47bd91439c
Copy link
test.mp4
@jaywcjlove
Copy link
Member

@58bcbedf47bd91439c 这是使用的 Collapse 折叠面板 组件?可以提供可以重现错误的示例,我看一下

@58bcbedf47bd91439c
Copy link
Author

@58bcbedf47bd91439c 这是使用的 Collapse 折叠面板 组件?可以提供可以重现错误的示例,我看一下
https://codesandbox.io/s/fast-fog-lh8dlx?file=/src/styles.css

@jaywcjlove
Copy link
Member

@58bcbedf47bd91439c 升级到 v4.22.1,这个因为高度动画引起的,现在计算了子节点的高度,这样可能存在隐患,比如子节点 通过 position 定位就会发生计算错误

@58bcbedf47bd91439c
Copy link
Author
58bcbedf47bd91439c commented Nov 9, 2023

@58bcbedf47bd91439c 升级到 v4.22.1,这个因为高度动画引起的,现在计算了子节点的高度,这样可能存在隐患,比如子节点 通过 position 定位就会发生计算错误

你好,我找到原因了, offsetHeight 包括元素的边框、内边距和滚动条(如果存在)的高度,代码中额外增加了,
paddingTop 很热paddingBottom
image

这是示例 https://codesandbox.io/s/fast-fog-lh8dlx?file=/src/App.js

@jaywcjlove
Copy link
Member

@58bcbedf47bd91439c 不需要这个高度?

@58bcbedf47bd91439c
Copy link
Author

@58bcbedf47bd91439c 不需要这个高度?

高度计算重复了

@jaywcjlove
Copy link
Member

@58bcbedf47bd91439c https://codesandbox.io/embed/quizzical-curran-jh78pg?fontsize=14&hidenavigation=1&theme=dark

上面是不需要更新即可解决问题

<Collapse.Panel header="Test1">
  <div>
  </div>
</Collapse.Panel>

Panel 里面套一层 div

@58bcbedf47bd91439c
Copy link
Author

@58bcbedf47bd91439c https://codesandbox.io/embed/quizzical-curran-jh78pg?fontsize=14&hidenavigation=1&theme=dark

上面是不需要更新即可解决问题

<Collapse.Panel header="Test1">
  <div>
  </div>
</Collapse.Panel>

Panel 里面套一层 div
测试可以,感谢支持!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants
0