aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2023-03-27 18:39:11 -0400
committerbobzel <zzzman@gmail.com>2023-03-27 18:39:11 -0400
commit93460a55b07c7dd13537dfe6290116679d9991e4 (patch)
tree995c8a88e61a44fc438bc32285977b31751c33d8 /src
parent8ab9236664c561d54d6a41ecb1eb2eaf6064fc0c (diff)
fixed selections on PDFs
Diffstat (limited to 'src')
-rw-r--r--src/client/views/nodes/DocumentView.tsx1
-rw-r--r--src/client/views/pdf/PDFViewer.tsx8
2 files changed, 7 insertions, 2 deletions
diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx
index c8f677c5f..541dddd83 100644
--- a/src/client/views/nodes/DocumentView.tsx
+++ b/src/client/views/nodes/DocumentView.tsx
@@ -337,6 +337,7 @@ export class DocumentViewInternal extends DocComponent<DocumentViewInternalProps
DocumentView.LongPress ||
this.props.onClickScriptDisable === 'always' ||
this._componentView?.onClickScriptDisable?.() ||
+ (this.props.onClickScriptDisable !== 'never' && (this.rootSelected() || this.props.isSelected())) ||
this._componentView?.isAnyChildContentActive?.()
);
}
diff --git a/src/client/views/pdf/PDFViewer.tsx b/src/client/views/pdf/PDFViewer.tsx
index 86d14c22e..eb3087399 100644
--- a/src/client/views/pdf/PDFViewer.tsx
+++ b/src/client/views/pdf/PDFViewer.tsx
@@ -7,7 +7,7 @@ import { Id } from '../../../fields/FieldSymbols';
import { InkTool } from '../../../fields/InkField';
import { Cast, NumCast, StrCast } from '../../../fields/Types';
import { TraceMobx } from '../../../fields/util';
-import { addStyleSheet, addStyleSheetRule, clearStyleSheetRules, emptyFunction, OmitKeys, smoothScroll, Utils } from '../../../Utils';
+import { addStyleSheet, addStyleSheetRule, clearStyleSheetRules, emptyFunction, OmitKeys, returnNone, smoothScroll, Utils } from '../../../Utils';
import { DocUtils } from '../../documents/Documents';
import { DragManager } from '../../util/DragManager';
import { SelectionManager } from '../../util/SelectionManager';
@@ -404,7 +404,10 @@ export class PDFViewer extends React.Component<IViewerProps> {
document.removeEventListener('pointermove', this.onSelectMove);
};
- onSelectMove = (e: PointerEvent) => e.stopPropagation();
+ onSelectMove = (e: PointerEvent) => {
+ this.props.DocumentView?.().docView?.cancelMoveEvents();
+ e.stopPropagation();
+ };
@action
onSelectEnd = (e: PointerEvent): void => {
@@ -530,6 +533,7 @@ export class PDFViewer extends React.Component<IViewerProps> {
<CollectionFreeFormView
{...OmitKeys(this.props, ['NativeWidth', 'NativeHeight', 'setContentView']).omit}
renderDepth={this.props.renderDepth + 1}
+ pointerEvents={returnNone}
isAnnotationOverlay={true}
fieldKey={this.props.fieldKey + '-annotations'}
CollectionView={undefined}