aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/pdf/PDFViewer.tsx
diff options
context:
space:
mode:
authormehekj <mehek.jethani@gmail.com>2022-11-07 12:57:52 -0500
committermehekj <mehek.jethani@gmail.com>2022-11-07 12:57:52 -0500
commita73521cdbccf9bed1326d24522e133fad4a0de26 (patch)
treee01371f6f845318831cf45f0dbc1d04d0d18f34c /src/client/views/pdf/PDFViewer.tsx
parent213a92ba3aa39d144754029fde32b9d69b0f51cf (diff)
parent31a51e9dda07e48c88166bffbc8f1ad7166cd624 (diff)
Merge branch 'master' into schema-mehek
Diffstat (limited to 'src/client/views/pdf/PDFViewer.tsx')
-rw-r--r--src/client/views/pdf/PDFViewer.tsx6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/client/views/pdf/PDFViewer.tsx b/src/client/views/pdf/PDFViewer.tsx
index 5c10c7cef..abc7336bd 100644
--- a/src/client/views/pdf/PDFViewer.tsx
+++ b/src/client/views/pdf/PDFViewer.tsx
@@ -79,6 +79,8 @@ export class PDFViewer extends React.Component<IViewerProps> {
private _initialScroll: Opt<number>;
private _forcedScroll = true;
+ selectionText = () => this._selectionText;
+
@observable isAnnotating = false;
// key where data is stored
@computed get allAnnotations() {
@@ -358,7 +360,8 @@ export class PDFViewer extends React.Component<IViewerProps> {
MarqueeAnnotator.clearAnnotations(this._savedAnnotations);
this._marqueeing = [e.clientX, e.clientY];
this.isAnnotating = true;
- if (e.target && ((e.target as any).className.includes('endOfContent') || (e.target as any).parentElement.className !== 'textLayer')) {
+ const target = e.target as any;
+ if (e.target && (target.className.includes('endOfContent') || (target.parentElement.className !== 'textLayer' && target.parentElement.parentElement?.className !== 'textLayer'))) {
this._textSelecting = false;
document.addEventListener('pointermove', this.onSelectMove); // need this to prevent document from being dragged if stopPropagation doesn't get called
} else {
@@ -574,6 +577,7 @@ export class PDFViewer extends React.Component<IViewerProps> {
docView={this.props.docViewPath().lastElement()}
finishMarquee={this.finishMarquee}
savedAnnotations={this.savedAnnotations}
+ selectionText={this.selectionText}
annotationLayer={this._annotationLayer.current}
mainCont={this._mainCont.current}
anchorMenuCrop={this._textSelecting ? undefined : this.crop}