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

🐛react在rerender后maxLines计算错误 #3087

Open
3 of 16 tasks
ouzhou opened this issue Jan 26, 2025 · 1 comment · May be fixed by #3089
Open
3 of 16 tasks

🐛react在rerender后maxLines计算错误 #3087

ouzhou opened this issue Jan 26, 2025 · 1 comment · May be fixed by #3089

Comments

@ouzhou
Copy link

ouzhou commented Jan 26, 2025

🏷 S2 Version / S2 版本

Package Version
@antv/s2 ^2.1.9
@antv/s2-react ^2.1.7
@antv/s2-react-components none

💻 Sheet Type / 表格类型

  • PivotSheet
  • TableSheet
  • PivotChartSheet
  • GridAnalysisSheet
  • StrategySheet
  • EditableSheet

🖋 Describe the bug / 问题描述

点击让组件重新渲染,3行变成了2行

⌨️ Code Snapshots / 代码片段

import { SheetComponent } from '@antv/s2-react';
import { useUpdate } from 'ahooks';
import { Button } from 'antd';

const data = Array(100).fill({
  province: 'aaaa'.repeat(100),
  city: 'aa',
});

export default function A() {
  const update = useUpdate();

  return (
    <div>
      <Button
        onClick={(e) => {
          update();
        }}
      >
        update
      </Button>

      <br />
      <SheetComponent
        sheetType="table"
        options={{
          width: 600,
          height: 480,
          style: {
            colCell: {
              maxLines: 3,
              wordWrap: true,
              textOverflow: 'ellipsis',
            },
            dataCell: {
              maxLines: 3,
              wordWrap: true,
              textOverflow: 'ellipsis',
            },
          },
        }}
        dataCfg={{
          fields: {
            columns: ['province', 'city'],
          },
          meta: [
            {
              field: 'province',
              name: '省份',
            },
            {
              field: 'city',
              name: '城市',
            },
          ],
          data,
        }}
      />
    </div>
  );
}

🔗 Reproduction link / 复现链接

No response

📋 Steps to Reproduce the Bug or Issue / 重现步骤

点按钮

😊 Expected Behavior / 期望行为

不要变成2行

😅 Current Behavior / 当前行为

重新渲染样式变更了

💻 OS / 操作系统

  • macOS
  • Windows
  • Linux
  • Others / 其他

🌏 Browser / 浏览器

  • Chrome
  • Edge
  • Firefox
  • Safari (Limited support / 有限支持)
  • IE (Nonsupport / 不支持)
  • Others / 其他
Copy link
Contributor

你好 @ouzhou:

提 Issue 须知

⚠️ 在提出问题前,请确保你已经仔细阅读👓/搜索🔍过 官方文档常见问题 以及 图表示例, 并且已经搜索查阅过相关 Issues 列表Discussions 列表. 当你确定自己的问题没有解决方案时,请提交 issue。 ⚠️

如果是使用问题,不知道怎么用,移步 Discussions 讨论区 并提供 有效信息 进行 提问

参与社区共建

这是一个开源项目, 我们也有繁忙的业务要做, 是用自己的业余时间在维护, 为爱发电, 精力有限, 所以有时候 issue 响应速度不是那么及时, 如果你遇到了问题, 或者对 IssuesDiscussions 列表的问题感兴趣, 可以直接认领并尝试修复 (贡献指南),帮助 S2 变得更好, 而不是一味的埋怨和催促, 我们不是甲方乙方的关系.

@Alexzjt Alexzjt linked a pull request Feb 1, 2025 that will close this issue
16 tasks
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 a pull request may close this issue.

1 participant