Skip to content

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

@fallenleavesguy

Description

@fallenleavesguy

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions