Unverified Commit b75ca54a authored by niko's avatar niko Committed by GitHub

fix Ellipsis break in firefox #1882 (#1921)

parent 54b25eaf
...@@ -137,11 +137,15 @@ export default class Ellipsis extends Component { ...@@ -137,11 +137,15 @@ export default class Ellipsis extends Component {
if (sh <= th) { if (sh <= th) {
shadowNode.innerHTML = text.substring(0, mid + 1) + suffix; shadowNode.innerHTML = text.substring(0, mid + 1) + suffix;
sh = shadowNode.offsetHeight; sh = shadowNode.offsetHeight;
if (sh > th) { if (sh > th || mid === begin) {
return mid; return mid;
} else { } else {
begin = mid; begin = mid;
mid = Math.floor((end - begin) / 2) + begin; if (end - begin === 1) {
mid = 1 + begin;
} else {
mid = Math.floor((end - begin) / 2) + begin;
}
return this.bisection(th, mid, begin, end, text, shadowNode); return this.bisection(th, mid, begin, end, text, shadowNode);
} }
} else { } else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment