niklasvh / html2canvas

Screenshots with JavaScript
https://html2canvas.hertzen.com/
MIT License
30.61k stars 4.81k forks source link

ios 上 两行文字不对齐 #2744

Open zhiyunguo opened 3 years ago

zhiyunguo commented 3 years ago

Bug reports:

1.首页dom渲染如下中间文字最多显示两行 css 设置 { overflow: hidden; -webkit-line-clamp: 2; text-overflow: ellipsis; -webkit-box-orient: vertical; display: -webkit-box; }

domImage

2.ios 截图 文字错位 ,第二行有空白

iosImage

  1. 安卓显示正常 但是也不显示省略号

Specifications

LaiLa06 commented 3 years ago

I have the same problem

heavon commented 3 years ago

Same problem,同样的问题,version 1.3.2 ,iOS,safari

zhangming8691 commented 3 years ago

I have the same problem,iOS lADPDhYBR4pMt1HNA4rNA4o_906_906

liuniansilence commented 3 years ago

同样问题,IOS下有问题。安卓没毛病

zhangming8691 commented 3 years ago

html2canvas@1.0.0-rc.4 can solve this problem, but there may be other problems, so you need to test more. I used v1.3.2 before

npm uninstall html2canvas
npm i html2canvas@1.0.0-rc.4 -S
zhangming8691 commented 3 years ago

html2canvas@1.0.0-rc.4 can solve this problem, but there may be other problems, so you need to test more. I used v1.3.2 before

npm uninstall html2canvas
npm i html2canvas@1.0.0-rc.4 -S

@liuniansilence

huli66 commented 2 years ago

可以把文字拆分成字符数组,配合flex,用元素换行代替文字换行,绕开这个问题 <p>{testName.map((item) => <span></span>)}</p>

p {
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
}
huli66 commented 2 years ago

可以把文字拆分成字符数组,配合flex,用元素换行代替文字换行,绕开这个问题

<p>
  {testName.map((item) => (
    <span>{item}</span>
  ))}
</p>
p {
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
}
huli66 commented 2 years ago

You can split the text into an array of characters, with flex, use element wrap instead of text wrap to circumvent this problem

<p>
  {testName.map((item) => (
    <span>{item}</span>
  ))}
</p>
p {
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
}
sphenginx commented 2 years ago

You can split the text into an array of characters, with flex, use element wrap instead of text wrap to circumvent this problem

<p>
  {testName.map((item) => (
    <span>{item}</span>
  ))}
</p>
p {
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
}

友情提示: map方法里面 需要 return 吧~

xiaoxiaoqian1217 commented 2 years ago

html2canvas@1.0.0-rc.4 can solve this problem, but there may be other problems, so you need to test more. I used v1.3.2 before

npm uninstall html2canvas
npm i html2canvas@1.0.0-rc.4 -S

我也遇到了,更新版本ios也没有解决

huli66 commented 2 years ago

html2canvas@1.0.0-rc.4 can solve this problem, but there may be other problems, so you need to test more. I used v1.3.2 before

npm uninstall html2canvas
npm i html2canvas@1.0.0-rc.4 -S

我也遇到了,更新版本ios也没有解决

跟ios和Safari版本没关系,是html2canvas对中文支持还有问题

huli66 commented 2 years ago

You can split the text into an array of characters, with flex, use element wrap instead of text wrap to circumvent this problem

<p>
  {testName.map((item) => (
    <span>{item}</span>
  ))}
</p>
p {
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
}

友情提示: map方法里面 需要 return 吧~

不需要的,箭头函数