From 71ef0cc1ef0883316b2eb3afae9188dd12a42dfc Mon Sep 17 00:00:00 2001 From: anika-ahluwalia Date: Mon, 22 Jun 2020 16:58:31 -0500 Subject: tweaks to preview --- .../views/collections/CollectionSchemaCells.tsx | 26 ++++++++++++---------- 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/client/views/collections/CollectionSchemaCells.tsx b/src/client/views/collections/CollectionSchemaCells.tsx index 7b76a5c84..6f43a2097 100644 --- a/src/client/views/collections/CollectionSchemaCells.tsx +++ b/src/client/views/collections/CollectionSchemaCells.tsx @@ -382,8 +382,6 @@ export class CollectionSchemaDocCell extends CollectionSchemaCell { } onFocus = () => { - - console.log(this._field); this._overlayDisposer?.(); this._overlayDisposer = OverlayView.Instance.addElement(, { x: 0, y: 0 }); } @@ -413,6 +411,16 @@ export class CollectionSchemaDocCell extends CollectionSchemaCell { } } + @action + isEditingCalling = (isEditing: boolean): void => { + this.showPreview(false, ""); + document.removeEventListener("keydown", this.onKeyDown); + isEditing && document.addEventListener("keydown", this.onKeyDown); + this._isEditing = isEditing; + this.props.setIsEditing(isEditing); + this.props.changeFocusedCellByIndex(this.props.row, this.props.col); + } + onDown = (e: any) => { this.props.changeFocusedCellByIndex(this.props.row, this.props.col); this.props.setPreviewDoc(this.props.rowProps.original); @@ -436,31 +444,24 @@ export class CollectionSchemaDocCell extends CollectionSchemaCell { } render() { - - const dragRef: React.RefObject = React.createRef(); - const reference = React.createRef(); - if (typeof this._field === "object" && this._doc && this._docTitle) { - - return (
{ this.onDown(e); }} - // onFocus={(e) => this.showPreview(true, e)} onPointerEnter={(e) => { this.showPreview(true, e); }} - // onBlur={(e) => { console.log("Blur"); this.showPreview(false, e) }} onPointerLeave={(e) => { this.showPreview(false, e); }} >
this._overlayDisposer?.()} ref={this.dropRef} + onFocus={this.onFocus} + onBlur={() => this._overlayDisposer?.()} > { this.onSetValue(value); + this.showPreview(false, ""); return true; })} /> -- cgit v1.2.3-70-g09d2