diff options
author | Bob Zeleznik <zzzman@gmail.com> | 2020-01-21 00:39:21 -0500 |
---|---|---|
committer | Bob Zeleznik <zzzman@gmail.com> | 2020-01-21 00:39:21 -0500 |
commit | 00a44ed4b0011ca6967f5d1512aa9fd1f6a1bdfe (patch) | |
tree | 9a7530519f2e2e9982bd5481db4ff6bc122bc2f5 /src | |
parent | 69e068d77731c25d9f1dbafb8c7d279e343a4e55 (diff) |
fix to avoid crash when rendering a non-string in an EditableView (eg when the document's title is displayed as a richtextBox and as an EditableView header on a DocumentView)
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/EditableView.tsx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/client/views/EditableView.tsx b/src/client/views/EditableView.tsx index faf02b946..0d677b8ce 100644 --- a/src/client/views/EditableView.tsx +++ b/src/client/views/EditableView.tsx @@ -5,6 +5,7 @@ import "./EditableView.scss"; import * as Autosuggest from 'react-autosuggest'; import { undoBatch } from '../util/UndoManager'; import { SchemaHeaderField } from '../../new_fields/SchemaHeaderField'; +import { ObjectField } from '../../new_fields/ObjectField'; export interface EditableProps { /** @@ -152,7 +153,7 @@ export class EditableView extends React.Component<EditableProps> { />; } else { if (this.props.autosuggestProps) this.props.autosuggestProps.resetValue(); - return ( + return (this.props.contents instanceof ObjectField ? (null) : <div className={`editableView-container-editing${this.props.oneLine ? "-oneLine" : ""}`} style={{ display: this.props.display, minHeight: "20px", height: `${this.props.height ? this.props.height : "auto"}`, maxHeight: `${this.props.maxHeight}` }} onClick={this.onClick}> |