aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/formattedText/FormattedTextBox.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2024-05-08 23:16:54 -0400
committerbobzel <zzzman@gmail.com>2024-05-08 23:16:54 -0400
commitd40efe81ab30485266b7b686dfb35c531e75a568 (patch)
treef12c9b151e1c6b35f4afa3962595386ce596e37c /src/client/views/nodes/formattedText/FormattedTextBox.tsx
parentb858bd3cad81da41e63b9f8e807e41421ca4aa34 (diff)
fixed text selection on web pages. cleaned up gptSummarize to work on any text.
Diffstat (limited to 'src/client/views/nodes/formattedText/FormattedTextBox.tsx')
-rw-r--r--src/client/views/nodes/formattedText/FormattedTextBox.tsx3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/client/views/nodes/formattedText/FormattedTextBox.tsx b/src/client/views/nodes/formattedText/FormattedTextBox.tsx
index e354aedb7..624721d7c 100644
--- a/src/client/views/nodes/formattedText/FormattedTextBox.tsx
+++ b/src/client/views/nodes/formattedText/FormattedTextBox.tsx
@@ -240,7 +240,6 @@ export class FormattedTextBox extends ViewBoxAnnotatableComponent<FormattedTextB
@action
setupAnchorMenu = () => {
AnchorMenu.Instance.Status = 'marquee';
-
AnchorMenu.Instance.OnClick = () => {
!this.layoutDoc.layout_showSidebar && this.toggleSidebar();
setTimeout(() => this._sidebarRef.current?.anchorMenuClick(this.makeLinkAnchor(undefined, OpenWhere.addRight, undefined, 'Anchored Selection', true))); // give time for sidebarRef to be created
@@ -292,6 +291,8 @@ export class FormattedTextBox extends ViewBoxAnnotatableComponent<FormattedTextB
DragManager.StartAnchorAnnoDrag([ele], new DragManager.AnchorAnnoDragData(this.DocumentView?.()!, () => this.getAnchor(true), targetCreator), e.pageX, e.pageY);
});
+
+ AnchorMenu.Instance.setSelectedText(window.getSelection()?.toString() ?? '');
const coordsB = this._editorView!.coordsAtPos(this._editorView!.state.selection.to);
this._props.rootSelected?.() && AnchorMenu.Instance.jumpTo(coordsB.left, coordsB.bottom);
let ele: Opt<HTMLDivElement>;