diff options
| author | anika-ahluwalia <anika.ahluwalia@gmail.com> | 2020-08-19 00:25:15 -0500 |
|---|---|---|
| committer | anika-ahluwalia <anika.ahluwalia@gmail.com> | 2020-08-19 00:25:15 -0500 |
| commit | 40971c01df7063073dfe3a5240da5053e094b45d (patch) | |
| tree | d68209d99b7f0aa04361a0fc41647729bb361cd2 /src/client/views/collections/CollectionSchemaMovableTableHOC.tsx | |
| parent | 4eb34dd81ebf0b5f64c4552265dd55ec0290e332 (diff) | |
fixed link label cut off
Diffstat (limited to 'src/client/views/collections/CollectionSchemaMovableTableHOC.tsx')
| -rw-r--r-- | src/client/views/collections/CollectionSchemaMovableTableHOC.tsx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/client/views/collections/CollectionSchemaMovableTableHOC.tsx b/src/client/views/collections/CollectionSchemaMovableTableHOC.tsx index 37e6c115d..e14cd1f4c 100644 --- a/src/client/views/collections/CollectionSchemaMovableTableHOC.tsx +++ b/src/client/views/collections/CollectionSchemaMovableTableHOC.tsx @@ -14,6 +14,8 @@ import { DocumentManager } from "../../util/DocumentManager"; import { SchemaHeaderField } from "../../../fields/SchemaHeaderField"; import { undoBatch } from "../../util/UndoManager"; import { SnappingManager } from "../../util/SnappingManager"; +import { SelectionManager } from "../../util/SelectionManager"; +import { DocumentView } from "../nodes/DocumentView"; library.add(faGripVertical, faTrash); @@ -226,12 +228,21 @@ export class MovableRow extends React.Component<MovableRowProps> { render() { const { children = null, rowInfo } = this.props; + if (!rowInfo) { return <ReactTableDefaults.TrComponent>{children}</ReactTableDefaults.TrComponent>; } const { original } = rowInfo; const doc = FieldValue(Cast(original, Doc)); + if (doc) { + const docView = DocumentManager.Instance.getDocumentViews(doc); + + if (this.props.rowFocused && docView.length) { + SelectionManager.SelectDoc(docView[0], false); + } + } + if (!doc) return <></>; const reference = React.createRef<HTMLDivElement>(); |
