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

动态修改height属性会导致水平滚动条被重置. #503

Open
fallenleavesguy opened this issue Sep 6, 2024 · 0 comments
Open

动态修改height属性会导致水平滚动条被重置. #503

fallenleavesguy opened this issue Sep 6, 2024 · 0 comments

Comments

@fallenleavesguy
Copy link
Contributor

Versions

5.70.0

package version
react 18.2.0
rsuite-table 5.70.0

What is the expected behavior?

动态修改height属性时,或表格高度变化时,水平滚动条位置保持不变。

What is the current behavior?

shouldUpdateScroll不传任何值时,默认为true. 动态修改height属性时,或表格高度变化时,水平滚动条位置被重置到0值。

height变化时,会执行到这里:

const vertical = event === 'bodyHeightChanged';

event当前值为: 'heightChanged', 导致执行了onScrollLeft(0), 水平滚动条被重置为0。

else if (shouldUpdateScroll) {
    const vertical = event === 'bodyHeightChanged';
    vertical ? onScrollTop(0) : onScrollLeft(0);
  }

What are the steps to reproduce?

设置为fillHeight并拖动改变浏览器高度,或动态修改height属性。

Any additional comments? (optional)

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

No branches or pull requests

1 participant