aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/collectionSchema/SchemaColumnHeader.tsx
diff options
context:
space:
mode:
authorNathan-SR <144961007+Nathan-SR@users.noreply.github.com>2024-06-04 14:17:50 -0400
committerNathan-SR <144961007+Nathan-SR@users.noreply.github.com>2024-06-04 14:17:50 -0400
commit22343f6ceb3175ff1794c4ff0ecda0471a7594af (patch)
tree79b8e3e987aa9fabb7fd8e8a50aab1c104964cff /src/client/views/collections/collectionSchema/SchemaColumnHeader.tsx
parentd215534d6f0d66db9d5bf15f9fefef3fe5398024 (diff)
key search on update
Diffstat (limited to 'src/client/views/collections/collectionSchema/SchemaColumnHeader.tsx')
-rw-r--r--src/client/views/collections/collectionSchema/SchemaColumnHeader.tsx11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/client/views/collections/collectionSchema/SchemaColumnHeader.tsx b/src/client/views/collections/collectionSchema/SchemaColumnHeader.tsx
index 4f9d53d18..32abc1780 100644
--- a/src/client/views/collections/collectionSchema/SchemaColumnHeader.tsx
+++ b/src/client/views/collections/collectionSchema/SchemaColumnHeader.tsx
@@ -61,6 +61,7 @@ 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;}
+ @action updateKeyDropdown = (value: string) => {this._props.schemaView.updateKeySearch(value)}
@action
sortClicked = (e: React.PointerEvent) => {
@@ -76,8 +77,10 @@ export class SchemaColumnHeader extends ObservableReactComponent<SchemaColumnHea
};
openKeyDropdown = () => {
- this._props.schemaView.openColumnMenu(this._props.columnIndex, false)
- this._displayKeysDropdown = true;
+ if (this.isDefaultTitle(this.fieldKey)){
+ this._props.schemaView.openColumnMenu(this._props.columnIndex, false)
+ this._displayKeysDropdown = true;
+ }
}
@action
@@ -122,7 +125,7 @@ export class SchemaColumnHeader extends ObservableReactComponent<SchemaColumnHea
@computed get editableView() {
const { color, fieldProps, pointerEvents } = this.renderProps(this._props);
- return <div className='schema-column-edit-wrapper' onPointerUp={() => this._props.schemaView.openColumnMenu(this._props.columnIndex, false)}
+ return <div className='schema-column-edit-wrapper' onPointerUp={() => this.openKeyDropdown()}
style={{
color,
width: '100%',
@@ -136,6 +139,7 @@ export class SchemaColumnHeader extends ObservableReactComponent<SchemaColumnHea
fieldContents={fieldProps}
editing={undefined}
updateAlt={this.updateAlt} // alternate title to display
+ updateSearch={this.updateKeyDropdown}
showKeyNotVal={true} // tells the EditableView to display the fieldKey itself, and not its value
GetValue={() => {
if (this.isDefaultTitle(this.fieldKey)) return '';
@@ -149,7 +153,6 @@ export class SchemaColumnHeader extends ObservableReactComponent<SchemaColumnHea
this._props.finishEdit?.();
return true;
} else if (enterKey) this.updateAlt(value);
-
this._props.finishEdit?.();
return true;
}, 'edit column header')}