aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/TooltipTextMenu.tsx
diff options
context:
space:
mode:
authormonikahedman <monika_hedman@brown.edu>2019-08-15 16:31:48 -0400
committermonikahedman <monika_hedman@brown.edu>2019-08-15 16:31:48 -0400
commit753c61c852aa17e6125f568fe0db394328765c7f (patch)
tree918d27dbfe9248c547a7796dc7142993f7cbb48a /src/client/util/TooltipTextMenu.tsx
parentb9f0c3d05eab364911007beb3c85d6d942097dab (diff)
parent13a377a36b0d93f931f57a6417fe920419a56026 (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 3cc70382c..450931b76 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;
@@ -191,6 +193,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
@@ -850,7 +856,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();
}