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

[Typography] 中英文Ellipsis表现不一致,中文多行 row 属性不生效 #3152

Closed
chungguo opened this issue Oct 22, 2024 · 7 comments
Assignees
Labels
🐞 bug Something isn't working to be published fixed, not be published

Comments

@chungguo
Copy link

chungguo commented Oct 22, 2024

重现链接

https://codesandbox.io/p/sandbox/tdesign-react-demo-forked-jcz38l

重现步骤

无需操作

期望结果

中英文表现一致

实际结果

中文单行显示,英文符合预期

Environment Info
相关版本 1.9.2
框架版本 / 基础库版本 React(18.2.0)
系统、浏览器 MacOS(15.0.1) Chrome(129.0.6668.101)
Node版本
Copy link
Contributor

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

@HaixingOoO HaixingOoO self-assigned this Oct 23, 2024
@HaixingOoO HaixingOoO added 🐞 bug Something isn't working and removed issueShoot labels Oct 24, 2024
@huangchen1031
Copy link
Collaborator

huangchen1031 commented Oct 24, 2024

看起来是Truncate.tsx里面getLines时用了line.split(' ')切分字符串用来计算内容宽度,如果改成line.split('')是不是就能兼容汉字了~

@chungguo
Copy link
Author

看起来是Truncate.tsx里面getLines时用了line.split(' ')切分字符串用来计算内容宽度,如果改成line.split('')是不是就能兼容汉字了~

这样英文就会被按字母切割,而不是单词,延续Truncate的实现思路的话,需要重新实现分字算法,兼容甚至可能存在的中英文混排

@HaixingOoO
Copy link
Collaborator

看起来是Truncate.tsx里面getLines时用了line.split(' ')切分字符串用来计算内容宽度,如果改成line.split('')是不是就能兼容汉字了~

是的,也要join(''),測試過沒問題了

@huangchen1031
Copy link
Collaborator

看起来是Truncate.tsx里面getLines时用了line.split(' ')切分字符串用来计算内容宽度,如果改成line.split('')是不是就能兼容汉字了~

这样英文就会被按字母切割,而不是单词,延续Truncate的实现思路的话,需要重新实现分字算法,兼容甚至可能存在的中英文混排

考虑国际化的话不同文字的逻辑还不一样,想想都难搞~

@huangchen1031
Copy link
Collaborator

看起来是Truncate.tsx里面getLines时用了line.split(' ')切分字符串用来计算内容宽度,如果改成line.split('')是不是就能兼容汉字了~

是的,也要join(''),測試過沒問題了

大佬666

@uyarn uyarn added the to be published fixed, not be published label Oct 25, 2024
@uyarn
Copy link
Collaborator

uyarn commented Oct 31, 2024

fixed 1.9.3

@uyarn uyarn closed this as completed Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working to be published fixed, not be published
Projects
None yet
Development

No branches or pull requests

4 participants