You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The component wouldn't initialize properly sometimes.
In Android and PC broswer it works well.
Generally, window.getComputedStyle(this.target)would get an Object with property width width a certain value like 100px. But sometimes Safari would get a auto value of width in getComputedStyle(this.target), that led to no wrap in canvas and calcIndexes() got the wrong result of [0]. Not always, there's a chance that that would happen.
Could I get react-lines-ellipsis via cdn? I would provide a demo.
The text was updated successfully, but these errors were encountered:
Oh, when I set a width in inlined style to parent node and use this.target.getBoundingClientRect().width in copyStyleToCanvas(), it will always get a certain correct width.
I believe there are some mechanisms in getComputedStyle when the component mounted.
ke1vin4real
changed the title
window.getComputedStyle(this.target) wouldn't get proper width in iOS Safari sometimes
window.getComputedStyle(this.target) wouldn't get correct width in iOS Safari sometimes
Jun 18, 2019
OS: iOS 12.3.1
Broswer: Safari
Library: "preact": "8.2.9", "react-lines-ellipsis": "0.14.1"
Code snippet:
The component wouldn't initialize properly sometimes.
In Android and PC broswer it works well.
Generally,
window.getComputedStyle(this.target)
would get an Object with propertywidth
width a certain value like100px
. But sometimes Safari would get aauto
value of width ingetComputedStyle(this.target)
, that led to no wrap in canvas andcalcIndexes()
got the wrong result of[0]
. Not always, there's a chance that that would happen.Could I get
react-lines-ellipsis
via cdn? I would provide a demo.The text was updated successfully, but these errors were encountered: