aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/FormattedTextBox.tsx
diff options
context:
space:
mode:
authorbob <bcz@cs.brown.edu>2020-01-24 16:34:37 -0500
committerbob <bcz@cs.brown.edu>2020-01-24 16:34:37 -0500
commit34ba9b8c3ce48c51dfb1d330d5285e0eadf92030 (patch)
tree953dcc1fb0e81b4197266122a8ce969a7459aa9d /src/client/views/nodes/FormattedTextBox.tsx
parent557e0fd8c41fbae8ddc0ba34be786c912338db23 (diff)
parent416541c18545cabe0c1b25d698770d7a50a9136e (diff)
made dataDoc be a data doc, not a layout doc & stopped expanding templates in DocumentContentsView. changed autoHeight to be _autoHeight layout property.
Diffstat (limited to 'src/client/views/nodes/FormattedTextBox.tsx')
-rw-r--r--src/client/views/nodes/FormattedTextBox.tsx8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/client/views/nodes/FormattedTextBox.tsx b/src/client/views/nodes/FormattedTextBox.tsx
index ef92ddf2e..46000a03d 100644
--- a/src/client/views/nodes/FormattedTextBox.tsx
+++ b/src/client/views/nodes/FormattedTextBox.tsx
@@ -530,7 +530,7 @@ export class FormattedTextBox extends DocAnnotatableComponent<(FieldViewProps &
);
this._heightReactionDisposer = reaction(
- () => [this.layoutDoc[WidthSym](), this.layoutDoc.autoHeight],
+ () => [this.layoutDoc[WidthSym](), this.layoutDoc._autoHeight],
() => this.tryUpdateHeight()
);
@@ -1051,12 +1051,12 @@ export class FormattedTextBox extends DocAnnotatableComponent<(FieldViewProps &
@action
tryUpdateHeight(limitHeight?: number) {
let scrollHeight = this._ref.current?.scrollHeight;
- if (!this.layoutDoc.animateToPos && this.layoutDoc.autoHeight && scrollHeight &&
+ if (!this.layoutDoc.animateToPos && this.layoutDoc._autoHeight && scrollHeight &&
getComputedStyle(this._ref.current!.parentElement!).top === "0px") { // if top === 0, then the text box is growing upward (as the overlay caption) which doesn't contribute to the height computation
if (limitHeight && scrollHeight > limitHeight) {
scrollHeight = limitHeight;
this.layoutDoc.limitHeight = undefined;
- this.layoutDoc.autoHeight = false;
+ this.layoutDoc._autoHeight = false;
}
const nh = this.Document.isTemplateForField ? 0 : NumCast(this.dataDoc._nativeHeight, 0);
const dh = NumCast(this.layoutDoc._height, 0);
@@ -1084,7 +1084,7 @@ export class FormattedTextBox extends DocAnnotatableComponent<(FieldViewProps &
return (
<div className={`formattedTextBox-cont`} ref={this._ref}
style={{
- height: this.layoutDoc.autoHeight ? "max-content" : undefined,
+ height: this.layoutDoc._autoHeight ? "max-content" : undefined,
background: this.props.hideOnLeave ? "rgba(0,0,0 ,0.4)" : undefined,
opacity: this.props.hideOnLeave ? (this._entered ? 1 : 0.1) : 1,
color: this.props.hideOnLeave ? "white" : "inherit",