aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/TooltipTextMenu.tsx
diff options
context:
space:
mode:
authorSam Wilkins <samwilkins333@gmail.com>2019-08-14 22:03:20 -0400
committerSam Wilkins <samwilkins333@gmail.com>2019-08-14 22:03:20 -0400
commit750a3333392724d10675ac4e2a6e124dc248bbe0 (patch)
tree93928b05d3ec9de155e7c07d989093009c6f2ed5 /src/client/util/TooltipTextMenu.tsx
parent244952ccc52bf66ac34eeea7d5469d0ba6313aff (diff)
parent71f27b718d9be29034ba233b5be18ea29f59f30b (diff)
resolved merge conflicts
Diffstat (limited to 'src/client/util/TooltipTextMenu.tsx')
-rw-r--r--src/client/util/TooltipTextMenu.tsx9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/client/util/TooltipTextMenu.tsx b/src/client/util/TooltipTextMenu.tsx
index d33a52d7f..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;
@@ -191,8 +193,6 @@ export class TooltipTextMenu {
this.update(view, undefined);
- //view.dom.parentNode!.parentNode!.insertBefore(this.tooltip, view.dom.parentNode);
-
// add tooltip to outerdiv to circumvent scaling problem
const outer_div = this.editorProps.outer_div;
outer_div && outer_div(this.wrapper);
@@ -855,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();
}
@@ -969,7 +970,7 @@ export class TooltipTextMenu {
});
}
}
- if (!ref_node.isLeaf) {
+ if (!ref_node.isLeaf && ref_node.childCount > 0) {
ref_node = ref_node.child(0);
}
return ref_node;