aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNathan-SR <144961007+Nathan-SR@users.noreply.github.com>2024-07-01 13:18:22 -0400
committerNathan-SR <144961007+Nathan-SR@users.noreply.github.com>2024-07-01 13:18:22 -0400
commitc9e3b7679247b615b1821d913b2648a0c1560c5a (patch)
treeeefe027be2dd1a773a15fc4bb792fd8c1f85a27d /src
parentfc4b71f2623fe1602d911b71828b8b3f6c0ce0cd (diff)
keymenu no longer opened on dragged col drop
Diffstat (limited to 'src')
-rw-r--r--src/client/views/collections/collectionSchema/CollectionSchemaView.tsx4
-rw-r--r--src/client/views/collections/collectionSchema/SchemaColumnHeader.tsx12
2 files changed, 9 insertions, 7 deletions
diff --git a/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx b/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx
index 2f62b1c8d..d0b531ad6 100644
--- a/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx
+++ b/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx
@@ -434,7 +434,7 @@ export class CollectionSchemaView extends CollectionSubView() {
this.closeColumnMenu();
this._headerRefs.forEach(ref => ref.toggleEditing(false));
this._draggedColIndex = index;
- this.setColDrag(true);
+ this.setColDrag(true);
const dragData = new DragManager.ColumnDragData(index);
const dragEles = [this._colEles[index]];
this.childDocs.forEach(doc => dragEles.push(this._rowEles.get(doc).children[1].children[index]));
@@ -741,7 +741,7 @@ export class CollectionSchemaView extends CollectionSubView() {
@action
onInternalDrop = (e: Event, de: DragManager.DropEvent) => {
if (de.complete.columnDragData) {
- this.setColDrag(false);
+ setTimeout(() => {this.setColDrag(false);});
e.stopPropagation();
return true;
}
diff --git a/src/client/views/collections/collectionSchema/SchemaColumnHeader.tsx b/src/client/views/collections/collectionSchema/SchemaColumnHeader.tsx
index 2b56ae881..22237f448 100644
--- a/src/client/views/collections/collectionSchema/SchemaColumnHeader.tsx
+++ b/src/client/views/collections/collectionSchema/SchemaColumnHeader.tsx
@@ -23,7 +23,6 @@ import { undoable } from '../../../util/UndoManager';
import { FInfo } from '../../../documents/Documents';
import { ColumnType } from '../../../../fields/SchemaHeaderField';
import { IconButton, Size } from 'browndash-components';
-import { TbHospital } from 'react-icons/tb';
export enum SchemaFieldType {
Header, Cell
@@ -70,10 +69,13 @@ export class SchemaColumnHeader extends ObservableReactComponent<SchemaColumnHea
getFinfo = computedFn((fieldKey: string) => this._props.schemaView?.fieldInfos.get(fieldKey));
setColumnValues = (field: string, defaultValue: string) => {this._props.schemaView?.setKey(field, defaultValue, this._props.columnIndex);}
- @action updateAlt = (newAlt: string) => {this._altTitle = newAlt;}
- updateKeyDropdown = (value: string) => {this._props.schemaView.updateKeySearch(value)}
- toggleEditing = (editing: boolean) => {this._inputRef?.setIsEditing(editing); this._inputRef?.setIsFocused(editing);}
- openKeyDropdown = () => {this._props.schemaView.openColumnMenu(this._props.columnIndex, false)}
+ @action updateAlt = (newAlt: string) => {this._altTitle = newAlt};
+ updateKeyDropdown = (value: string) => {this._props.schemaView.updateKeySearch(value)};
+ openKeyDropdown = () => {console.log('caled'); console.log(this._props.schemaView._colBeingDragged); !this._props.schemaView._colBeingDragged && this._props.schemaView.openColumnMenu(this._props.columnIndex, false)};
+ toggleEditing = (editing: boolean) => {
+ this._inputRef?.setIsEditing(editing);
+ this._inputRef?.setIsFocused(editing);
+ };
@action
setupDrag = (e: React.PointerEvent) => {