aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBob Zeleznik <zzzman@gmail.com>2019-04-10 21:48:37 -0400
committerBob Zeleznik <zzzman@gmail.com>2019-04-10 21:48:37 -0400
commit6dfc6d36933ea067f0bb0f7b8c3204f9dd907f4b (patch)
tree37a73cdf0100170a2f316edf34cd95151e900c9b /src
parent4e45ad641bd34c4703188e69a93a23243f3659a4 (diff)
fixed text duplication when editing.
Diffstat (limited to 'src')
-rw-r--r--src/client/views/Main.tsx6
1 files changed, 6 insertions, 0 deletions
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<HTMLDivElement>;
@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;
}