diff options
| author | Bob Zeleznik <zzzman@gmail.com> | 2020-07-17 03:26:29 -0400 |
|---|---|---|
| committer | Bob Zeleznik <zzzman@gmail.com> | 2020-07-17 03:26:29 -0400 |
| commit | c63b780580b5cd9c079da361ff65019641782226 (patch) | |
| tree | 9e8beb8501f2333bdb32bea74cfbf2ef9ac1ea32 /src/client/views/nodes/formattedText/RichTextMenu.tsx | |
| parent | 60819bced2eb67282b77e25c77939dd45d01e7d8 (diff) | |
fixed issues with embedded text boxes in text boxes when displayed multiple times (alias or minimap). fixed richtextmenu to always "point to" the selected text box.
Diffstat (limited to 'src/client/views/nodes/formattedText/RichTextMenu.tsx')
| -rw-r--r-- | src/client/views/nodes/formattedText/RichTextMenu.tsx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/client/views/nodes/formattedText/RichTextMenu.tsx b/src/client/views/nodes/formattedText/RichTextMenu.tsx index 63f6fdc54..9890ef2c1 100644 --- a/src/client/views/nodes/formattedText/RichTextMenu.tsx +++ b/src/client/views/nodes/formattedText/RichTextMenu.tsx @@ -156,7 +156,9 @@ export default class RichTextMenu extends AntimodeMenu { @action changeView(view: EditorView) { - this.view = view; + if ((view as any)?.TextView?.props.isSelected(true)) { + this.view = view; + } } update(view: EditorView, lastState: EditorState | undefined) { @@ -165,8 +167,7 @@ export default class RichTextMenu extends AntimodeMenu { @action public async updateFromDash(view: EditorView, lastState: EditorState | undefined, props: any) { - if (!view) { - console.log("no editor? why?"); + if (!view || !(view as any).TextView?.props.isSelected(true)) { return; } this.view = view; @@ -318,7 +319,7 @@ export default class RichTextMenu extends AntimodeMenu { } destroy() { - this.fadeOut(true); + !this.TextView.props.isSelected(false) && this.fadeOut(true); } @action |
