Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

BasicTable列表canResize属性为true时合计行不能横向滚动 #7422

Closed
Jalonly opened this issue Nov 3, 2024 · 2 comments
Closed

Comments

@Jalonly
Copy link

Jalonly commented Nov 3, 2024

版本号:

3.5.、3.6.,3.7.*

问题描述:

BasicTable列表canResize属性为true时合计行不能横向滚动,列居多,存在横向滚动条,拉动横向滚动条,下发合计行不随之滚动。

错误截图:

友情提示:

  • 未按格式要求发帖、描述过于简单的,会被直接删掉;
  • 描述问题请图文并茂,方便我们理解并快速定位问题;
  • 如果使用的不是master,请说明你使用的分支;
@zhangdaiscott
Copy link
Member

zy

@jeecgDeveloper
Copy link

已修复,下一版本发布。
你本地可在src/components/Table/src/hooks/useTableFooter.ts文件按照如下图进行修改:
image


  function handleSummary() {
    const { showSummary, canResize } = unref(propsRef);
    if (!showSummary || unref(getIsEmptyData)) return;
    nextTick(() => {
      const tableEl = unref(tableElRef);
      if (!tableEl) return;
      let bodyDom;
      // update-begin--author:liaozhiyang---date:20241111---for:【issues/7422】BasicTable列表canResize属性为true时合计行不能横向滚动
      if (canResize) {
        setTimeout(() => {
          bodyDom = tableEl.$el.querySelector('.ant-table-body');
        }, 0);
      } else {
        bodyDom = tableEl.$el.querySelector('.ant-table-content');
      }
      setTimeout(() => {
        useEventListener({
          el: bodyDom,
          name: 'scroll',
          listener: () => {
            const footerBodyDom = tableEl.$el.querySelector('.ant-table-footer .ant-table-content') as HTMLDivElement;
            if (!footerBodyDom || !bodyDom) return;
            footerBodyDom.scrollLeft = bodyDom.scrollLeft;
          },
          wait: 0,
          options: true,
        });
      }, 0);
      // update-end--author:liaozhiyang---date:20241111---for:【issues/7422】BasicTable列表canResize属性为true时合计行不能横向滚动
    });
  }

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants