aboutsummaryrefslogtreecommitdiff
path: root/src/client/util
diff options
context:
space:
mode:
authorBob Zeleznik <zzzman@gmail.com>2019-08-14 20:40:53 -0400
committerBob Zeleznik <zzzman@gmail.com>2019-08-14 20:40:53 -0400
commit71f27b718d9be29034ba233b5be18ea29f59f30b (patch)
tree6df84a0b7eb48d3239b5db1adeec1a0f1b32780c /src/client/util
parent658cd061fd1927148c3542e4f82f06c6805f98db (diff)
fixed text menu and text selection
Diffstat (limited to 'src/client/util')
-rw-r--r--src/client/util/TooltipTextMenu.tsx9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/client/util/TooltipTextMenu.tsx b/src/client/util/TooltipTextMenu.tsx
index 48f02d38a..783492d74 100644
--- a/src/client/util/TooltipTextMenu.tsx
+++ b/src/client/util/TooltipTextMenu.tsx
@@ -67,6 +67,8 @@ export class TooltipTextMenu {
@observable
private _storedMarks: Mark<any>[] | null | undefined;
+ public HackToFixTextSelectionGlitch: boolean = false;
+
constructor(view: EditorView, editorProps: FieldViewProps & FormattedTextBoxProps) {
this.view = view;
@@ -190,6 +192,10 @@ export class TooltipTextMenu {
this.updateListItemDropdown(":", this.listTypeBtnDom);
this.update(view, undefined);
+
+ // add tooltip to outerdiv to circumvent scaling problem
+ const outer_div = this.editorProps.outer_div;
+ outer_div && outer_div(this.wrapper);
}
//label of dropdown will change to given label
@@ -849,7 +855,8 @@ export class TooltipTextMenu {
this.updateFontSizeDropdown("Various");
}
}
- this.view.dispatch(this.view.state.tr.setStoredMarks(this._activeMarks));
+ !this.HackToFixTextSelectionGlitch &&
+ this.view.dispatch(this.view.state.tr.setStoredMarks(this._activeMarks)); // bcz: what's the purpose of this line? It messes up text selection without the Hack.
this.update_mark_doms();
}