diff options
author | yipstanley <stanley_yip@brown.edu> | 2019-07-28 18:02:58 -0400 |
---|---|---|
committer | yipstanley <stanley_yip@brown.edu> | 2019-07-28 18:02:58 -0400 |
commit | 3f54bd76fd806ac3e7b2380fe45e71549ea65955 (patch) | |
tree | dae7e84230478d151855798b4efb55da1299e6e9 | |
parent | cb2347347c8d9d2a0f1531479c73ecbcb3008128 (diff) |
only enter wlil trigger the editable view in schema cells
-rw-r--r-- | src/client/views/collections/CollectionSchemaCells.tsx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/client/views/collections/CollectionSchemaCells.tsx b/src/client/views/collections/CollectionSchemaCells.tsx index f1e013edd..194765880 100644 --- a/src/client/views/collections/CollectionSchemaCells.tsx +++ b/src/client/views/collections/CollectionSchemaCells.tsx @@ -25,6 +25,7 @@ import { library } from '@fortawesome/fontawesome-svg-core'; import { faExpand } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { SchemaHeaderField } from "../../../new_fields/SchemaHeaderField"; +import { KeyCodes } from "../../northstar/utils/KeyCodes"; library.add(faExpand); @@ -66,7 +67,7 @@ export class CollectionSchemaCell extends React.Component<CellProps> { @action onKeyDown = (e: KeyboardEvent): void => { - if (this.props.isFocused && this.props.isEditable) { + if (this.props.isFocused && this.props.isEditable && e.keyCode === KeyCodes.ENTER) { document.removeEventListener("keydown", this.onKeyDown); this._isEditing = true; this.props.setIsEditing(true); |