From 6dfc6d36933ea067f0bb0f7b8c3204f9dd907f4b Mon Sep 17 00:00:00 2001 From: Bob Zeleznik Date: Wed, 10 Apr 2019 21:48:37 -0400 Subject: fixed text duplication when editing. --- src/client/views/Main.tsx | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/client/views/Main.tsx b/src/client/views/Main.tsx index b73b55fb1..684738657 100644 --- a/src/client/views/Main.tsx +++ b/src/client/views/Main.tsx @@ -208,15 +208,21 @@ export class Main extends React.Component { _textRect: any; _textXf: Transform = Transform.Identity(); _textScroll: number = 0; + _textColor: string | null = null; _textTargetDiv: HTMLDivElement | undefined; _textProxyDiv: React.RefObject; @action SetTextDoc(textDoc?: Document, div?: HTMLDivElement, tx?: Transform) { + if (this._textTargetDiv) + this._textTargetDiv.style.color = this._textColor; + this._textDoc = undefined; this._textDoc = textDoc; this._textXf = tx ? tx : Transform.Identity(); this._textTargetDiv = div; if (div) { + this._textColor = div.style.color; + div.style.color = "transparent"; this._textRect = div.getBoundingClientRect(); this._textScroll = div.scrollTop; } -- cgit v1.2.3-70-g09d2