From 3c56d05d401d2015545bd42868f4fc553db6944b Mon Sep 17 00:00:00 2001 From: Melissa Zhang Date: Thu, 13 Aug 2020 17:36:15 -0700 Subject: stopPropagation for left/right arrow keys while editing headers or cells (still buggy), removed unused code --- src/client/views/collections/CollectionSchemaView.tsx | 6 ------ src/client/views/collections/SchemaTable.tsx | 2 ++ 2 files changed, 2 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/client/views/collections/CollectionSchemaView.tsx b/src/client/views/collections/CollectionSchemaView.tsx index 892148cd7..2e9d2517c 100644 --- a/src/client/views/collections/CollectionSchemaView.tsx +++ b/src/client/views/collections/CollectionSchemaView.tsx @@ -131,12 +131,6 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) { } } - @action - toggleIsOpen = (): void => { - this._isOpen = !this._isOpen; - this.setHeaderIsEditing(this._isOpen); - } - @action changeColumnType = (type: ColumnType, col: any): void => { this._openTypes = false; diff --git a/src/client/views/collections/SchemaTable.tsx b/src/client/views/collections/SchemaTable.tsx index 24c2ee1ee..d997606f6 100644 --- a/src/client/views/collections/SchemaTable.tsx +++ b/src/client/views/collections/SchemaTable.tsx @@ -383,6 +383,8 @@ export class SchemaTable extends React.Component { const pdoc = FieldValue(this.childDocs[this._focusedCell.row]); pdoc && this.props.setPreviewDoc(pdoc); + } else if ((this._cellIsEditing || this.props.headerIsEditing) && (e.keyCode === 37 || e.keyCode === 39)) { + e.stopPropagation(); // stopPropagation for left/right arrows } } -- cgit v1.2.3-70-g09d2