aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/TooltipTextMenu.tsx
diff options
context:
space:
mode:
authormonikahedman <monika_hedman@brown.edu>2019-08-15 16:51:49 -0400
committermonikahedman <monika_hedman@brown.edu>2019-08-15 16:51:49 -0400
commit1f6f19388e081b856a3d2f7243bcfdca37a2f826 (patch)
treeff8c75a96c56c021e4cc8bf2741f5fd3c4252d77 /src/client/util/TooltipTextMenu.tsx
parent9d76e8c2f318b4c6a4f941e6d2c8e795bc93f372 (diff)
parentb6b18c2243fb6b6c0e0850962d433b0bb08753c9 (diff)
pulled from master
Diffstat (limited to 'src/client/util/TooltipTextMenu.tsx')
-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 389d96636..46961e416 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;
@@ -192,6 +194,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
@@ -879,7 +885,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();
}