aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/CollectionSchemaHeaders.tsx
diff options
context:
space:
mode:
authorLionel Han <47760119+IGoByJoe@users.noreply.github.com>2020-09-02 20:48:17 -0700
committerLionel Han <47760119+IGoByJoe@users.noreply.github.com>2020-09-02 20:48:17 -0700
commit0cbf69270e2aa999b81c90f27429756d9fbd5ca2 (patch)
tree06fb7a175aa1d9e73271c717639e08cc561d6b08 /src/client/views/collections/CollectionSchemaHeaders.tsx
parent2b3e0ca4f889054020fd9b3c4a1e2db8d57581c1 (diff)
parentaa74a1e78dbd874942def0b763917198df51e01b (diff)
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into bug_fixes
Diffstat (limited to 'src/client/views/collections/CollectionSchemaHeaders.tsx')
-rw-r--r--src/client/views/collections/CollectionSchemaHeaders.tsx8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/client/views/collections/CollectionSchemaHeaders.tsx b/src/client/views/collections/CollectionSchemaHeaders.tsx
index 94f9d4f92..d2a1234ed 100644
--- a/src/client/views/collections/CollectionSchemaHeaders.tsx
+++ b/src/client/views/collections/CollectionSchemaHeaders.tsx
@@ -380,7 +380,7 @@ export class KeysDropdown extends React.Component<KeysDropdownProps> {
@action
renderFilterOptions = (): JSX.Element[] | JSX.Element => {
- if (!this._isOpen) {
+ if (!this._isOpen || !this.props.dataDoc) {
this.defaultMenuHeight = 0;
return <></>;
}
@@ -388,7 +388,7 @@ export class KeysDropdown extends React.Component<KeysDropdownProps> {
const colpos = this._searchTerm.indexOf(":");
const temp = this._searchTerm.slice(colpos + 1, this._searchTerm.length);
if (this.docSafe.length === 0) {
- this.docSafe = DocListCast(this.props.dataDoc![this.props.fieldKey]);
+ this.docSafe = DocListCast(this.props.dataDoc[this.props.fieldKey]);
}
const docs = this.docSafe;
docs.forEach((doc) => {
@@ -476,8 +476,8 @@ export class KeysDropdown extends React.Component<KeysDropdownProps> {
removeFilters = (e: React.PointerEvent): void => {
const keyOptions: string[] = [];
- if (this.docSafe.length === 0) {
- this.docSafe = DocListCast(this.props.dataDoc![this.props.fieldKey]);
+ if (this.docSafe.length === 0 && this.props.dataDoc) {
+ this.docSafe = DocListCast(this.props.dataDoc[this.props.fieldKey]);
}
const docs = this.docSafe;
docs.forEach((doc) => {