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.Paragraph 截取行数显示不正确 #19219
Comments
我这里无法复现,能截个 gif 缩放看一下吗? |
缩放产生的精度问题 😣 |
Hello @shijunwen. We totally like your proposal/feedback, welcome to send us Pull Request for it. Please send your Pull Request to proper branch (feature branch for new feature, master for bugfix and other changes), fill the [Pull Request Template] here, provide changelog/TypeScript/documentation/test cases if needed and make sure CI passed, we will review it soon. Appreciate it advance and we are looking forword to your contribution! 你好 @shijunwen, 我们完全同意你的提议/反馈,欢迎直接在此仓库 创建一个 Pull Request 来解决这个问题。请将 Pull Request 发到正确的分支(新特性发到 feature 分支,其他发到 master 分支),务必填写 Pull Request 内的预设模板,提供改动所需相应的 changelog、TypeScript 定义、测试用例、文档等,并确保 CI 通过,我们会尽快进行 Review,提前感谢和期待您的贡献! |
typography/util.tsx这个字符串截取的算法是不是有点问题,当childNodes的第1个node不是text类型且长度超过限制时,就会显示空 |
https://codesandbox.io/s/flamboyant-sammet-rhgrx?file=/src/App.tsx 在这个例子中看到的一个现象是在 chrome 上,line-height = Math.floor(font-size * line-height) ant-design/components/typography/util.tsx Line 75 in 6417e08
这里获取 line-height 时在 chrome 是不是应该采用 Math.floor |
我也遇到了一样的问题, 可以在 https://ant.design/components/typography/ 这里直接复现 看起来问题在于 https://github.com/ant-design/ant-design/blob/master/components/typography/util.tsx#L76 |
Reproduction link
Steps to reproduce
访问官网https://ant.design/components/typography-cn/#components-typography-demo-ellipsis
What is expected?
ellipsis={{ rows: 3, expandable: true }} 设置属性是3行,浏览器显示3行
What is actually happening?
ellipsis={{ rows: 3, expandable: true }} 设置属性是3行,浏览器显示4行
当浏览器放大,缩小到一定的分辨率时也会导致行数显示错误
The text was updated successfully, but these errors were encountered: