aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2021-03-29 20:36:47 -0400
committerbobzel <zzzman@gmail.com>2021-03-29 20:36:47 -0400
commit589f07ea018368057fe80b136c3fd2153efe0fcb (patch)
tree06e9a1749551397d6ec270da69a9cc2852955f33 /src
parent7db0fe589afa3281894afb0a0d3bd6b9983c9d33 (diff)
fixed text input after changes to active/selected
Diffstat (limited to 'src')
-rw-r--r--src/client/util/DragManager.ts7
-rw-r--r--src/client/views/DocComponent.tsx4
-rw-r--r--src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx2
-rw-r--r--src/client/views/nodes/formattedText/FormattedTextBox.tsx4
-rw-r--r--src/fields/util.ts2
5 files changed, 6 insertions, 13 deletions
diff --git a/src/client/util/DragManager.ts b/src/client/util/DragManager.ts
index abf1af669..c1235163b 100644
--- a/src/client/util/DragManager.ts
+++ b/src/client/util/DragManager.ts
@@ -379,12 +379,7 @@ export namespace DragManager {
if (docsBeingDragged.length) {
const pdfBox = dragElement.getElementsByTagName("canvas");
const pdfBoxSrc = ele.getElementsByTagName("canvas");
- Array.from(pdfBox).filter(pb => pb.width && pb.height).map((pb, i) => {
- const context = pb.getContext('2d')!;
- console.log(getComputedStyle(pb).width);
- console.log(getComputedStyle(pdfBoxSrc[i]).width);
- context.drawImage(pdfBoxSrc[i], 0, 0);
- });
+ Array.from(pdfBox).filter(pb => pb.width && pb.height).map((pb, i) => pb.getContext('2d')!.drawImage(pdfBoxSrc[i], 0, 0));
}
[dragElement, ...Array.from(dragElement.getElementsByTagName('*'))].forEach(ele =>
ele.hasAttribute("style") && ((ele as any).style.pointerEvents = "none"));
diff --git a/src/client/views/DocComponent.tsx b/src/client/views/DocComponent.tsx
index 5c0fe6b97..566e884c5 100644
--- a/src/client/views/DocComponent.tsx
+++ b/src/client/views/DocComponent.tsx
@@ -203,10 +203,10 @@ export function ViewBoxAnnotatableComponent<P extends ViewBoxAnnotatableProps, T
if (effectiveAcl === AclAddonly) {
added.map(doc => {
- this.props.layerProvider?.(doc, true);
- Doc.AddDocToList(targetDataDoc, annotationKey ?? this.annotationKey, doc);
doc.context = this.props.Document;
if (annotationKey ?? this._annotationKey) Doc.GetProto(doc).annotationOn = this.props.Document;
+ this.props.layerProvider?.(doc, true);
+ Doc.AddDocToList(targetDataDoc, annotationKey ?? this.annotationKey, doc);
});
}
else {
diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
index b74bca5d3..cf48a9237 100644
--- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
@@ -1043,7 +1043,7 @@ export class CollectionFreeFormView extends CollectionSubView<PanZoomDocument, P
freezeDimensions={this.props.childFreezeDimensions}
dropAction={StrCast(this.props.Document.childDropAction) as dropActionType}
bringToFront={this.bringToFront}
- isDocumentActive={() => this.props.isContentActive()}
+ isDocumentActive={this.props.isContentActive}
dontRegisterView={this.props.dontRegisterView}
pointerEvents={this.backgroundActive || this.props.childPointerEvents ? "all" :
(this.props.viewDefDivClick || (engine === "pass" && !this.props.isSelected(true))) ? "none" : undefined}
diff --git a/src/client/views/nodes/formattedText/FormattedTextBox.tsx b/src/client/views/nodes/formattedText/FormattedTextBox.tsx
index 28e58f6d8..7787dc3a6 100644
--- a/src/client/views/nodes/formattedText/FormattedTextBox.tsx
+++ b/src/client/views/nodes/formattedText/FormattedTextBox.tsx
@@ -1422,9 +1422,7 @@ export class FormattedTextBox extends ViewBoxAnnotatableComponent<(FieldViewProp
const proseHeight = this.ProseRef?.scrollHeight || 0;
const scrollHeight = this.ProseRef && Math.min(NumCast(this.layoutDoc.docMaxAutoHeight, proseHeight), proseHeight);
if (scrollHeight && this.props.renderDepth && !this.props.dontRegisterView) { // if top === 0, then the text box is growing upward (as the overlay caption) which doesn't contribute to the height computation
- const setScrollHeight = () => {
- this.rootDoc[this.fieldKey + "-scrollHeight"] = scrollHeight;
- };
+ const setScrollHeight = () => this.rootDoc[this.fieldKey + "-scrollHeight"] = scrollHeight;
if (this.rootDoc === this.layoutDoc.doc || this.layoutDoc.resolvedDataDoc) {
setScrollHeight();
} else setTimeout(setScrollHeight, 10); // if we have a template that hasn't been resolved yet, we can't set the height or we'd be setting it on the unresolved template. So set a timeout and hope its arrived...
diff --git a/src/fields/util.ts b/src/fields/util.ts
index 6c9c9d45c..ea91cc057 100644
--- a/src/fields/util.ts
+++ b/src/fields/util.ts
@@ -19,7 +19,7 @@ function _readOnlySetter(): never {
throw new Error("Documents can't be modified in read-only mode");
}
-const tracing = true;
+const tracing = false;
export function TraceMobx() {
tracing && trace();
}