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

[Table] 当width列宽总和小于 table 元素时, resizable拖动列到最大后不能再拖动 #1067

Closed
LoopZhou opened this issue Jun 24, 2022 · 7 comments
Assignees
Labels
to be published fixed, not be published

Comments

@LoopZhou
Copy link
Collaborator

tdesign-vue 版本

0.42.2

重现链接

https://codesandbox.io/s/tdesign-vue-demo-forked-3txuc4?file=/src/demo.vue

重现步骤

2022-06-24.10.39.25.mov

期望结果

列宽拖动后可以再拖动

实际结果

拖动到最大后,不能再拖动该列

框架版本

Vue(2.6.0)

浏览器版本

Chrome(99.0.4844.51)

系统版本

MacOS(10.15.7)

Node版本

12.22.0

补充说明

No response

@github-actions
Copy link
Contributor

👋 @LoopZhou,感谢给 TDesign 提出了 issue。
请根据 issue 模版确保背景信息的完善,我们将调查并尽快回复你。

@github-actions
Copy link
Contributor

♥️ 有劳 @realyuyanan @chaishi @cool-518 尽快确认问题。
确认有效后将下一步计划和可能需要的时间回复给 @LoopZhou

@LoopZhou
Copy link
Collaborator Author

在0.44.0版本中验证,该问题未解决。

@LoopZhou
Copy link
Collaborator Author

在width列宽总和小于 table 元素时的情况, 依旧有一些问题。
比如

  1. 线往左侧拖动缩小,结果是列宽往右侧移动增加了。
  2. 另外就是拖动后可能导致不能二次拖动的问题。

image

配置的width宽度小于table, 比如示例都是100px, 界面上实际是343px。 当往左侧拖动一点距离到300px。

image

colgroup的width变成了300px, 实际展示的效果是线往右侧移动了。实际展示列宽变成了618px, 因为resize默认拖动范围代码中配置的是const DEFAULT_MIN_WIDTH = 80; const DEFAULT_MAX_WIDTH = 600; 导致该列不能再拖动。

这种情况下,拖动时是否应该按比例来计算列宽的缩放大小呢?

@chaishi chaishi reopened this Jul 21, 2022
@ZTao-z
Copy link
Contributor

ZTao-z commented Jul 21, 2022

认领 #1067

@ZTao-z
Copy link
Contributor

ZTao-z commented Jul 25, 2022

定位到问题了:在列的宽度总和小于表的宽度,浏览器会自动撑开每一列,导致显示列宽度和设置的不一致。
具体可以参考这篇文章:https://x-front-team.github.io/2017/04/25/table-layout%E7%90%86%E8%A7%A3%E5%88%B0%E6%94%BE%E5%BC%83/

@uyarn
Copy link
Collaborator

uyarn commented Aug 4, 2022

fixed 0.45.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
to be published fixed, not be published
Projects
None yet
Development

No branches or pull requests

5 participants