From a8c131d8cfea94967230f398ce0b7599862f0ed7 Mon Sep 17 00:00:00 2001 From: sawka Date: Mon, 17 Apr 2023 16:19:29 -0700 Subject: [PATCH] more careful checking in setting line overflow. simple one way toggle --- src/linecomps.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/linecomps.tsx b/src/linecomps.tsx index 39e9d191..d35289c9 100644 --- a/src/linecomps.tsx +++ b/src/linecomps.tsx @@ -240,7 +240,13 @@ class LineCmd extends React.Component<{screen : LineContainerModel, line : LineT return; } let metaElemWidth = metaElem.offsetWidth; + if (metaElemWidth == 0) { + return; + } let metaChild = metaElem.firstChild; + if (metaChild == null) { + return; + } let children = metaChild.childNodes; let childWidth = 0; for (let i=0; i metaElemWidth); - if (isOverflow != this.isOverflow.get()) { + if (isOverflow && isOverflow != this.isOverflow.get()) { mobx.action(() => { this.isOverflow.set(isOverflow); })();