From e22bdd2db60954445c41f7e2ca75a8944de5288f Mon Sep 17 00:00:00 2001 From: bobzel Date: Mon, 17 Mar 2025 16:45:06 -0400 Subject: fixed table box scrolling --- .../views/nodes/DataVizBox/DocCreatorMenu/DocCreatorMenu.tsx | 10 ++++++---- src/client/views/nodes/DataVizBox/components/TableBox.tsx | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/client/views/nodes/DataVizBox/DocCreatorMenu/DocCreatorMenu.tsx b/src/client/views/nodes/DataVizBox/DocCreatorMenu/DocCreatorMenu.tsx index e3854e0e4..6d37f8f0f 100644 --- a/src/client/views/nodes/DataVizBox/DocCreatorMenu/DocCreatorMenu.tsx +++ b/src/client/views/nodes/DataVizBox/DocCreatorMenu/DocCreatorMenu.tsx @@ -625,10 +625,12 @@ export class DocCreatorMenu extends ObservableReactComponent await Promise.all(renderedTemplatePromises); } - setTimeout(() => { - this.setSuggestedTemplates(templates); - this._GPTLoading = false; - }); + setTimeout( + action(() => { + this.setSuggestedTemplates(templates); + this._GPTLoading = false; + }) + ); }; renderGPTImageCall = async (template: Template, col: Col, fieldNumber: number | undefined): Promise => { diff --git a/src/client/views/nodes/DataVizBox/components/TableBox.tsx b/src/client/views/nodes/DataVizBox/components/TableBox.tsx index 7ef4bca6b..221b15372 100644 --- a/src/client/views/nodes/DataVizBox/components/TableBox.tsx +++ b/src/client/views/nodes/DataVizBox/components/TableBox.tsx @@ -101,7 +101,7 @@ export class TableBox extends ObservableReactComponent { return this._props.docView?.()?.screenToViewTransform().Scale || 1; } @computed get rowHeight() { - return (this.viewScale * this._tableHeight) / this._tableDataIds.length; + return (this.viewScale * this._tableHeight) / (this._tableDataIds.length + 1); // add 1 for header row } @computed get startID() { return this.rowHeight ? Math.max(Math.floor(this._scrollTop / this.rowHeight) - 1, 0) : 0; @@ -401,8 +401,9 @@ export class TableBox extends ObservableReactComponent { this._tableHeight = r?.getBoundingClientRect().height ?? 0; } })}> -
+ {/*
*/} + {this.columns.map(col => ( { {this._tableDataIds .filter((rowId, i) => this.startID - 2 <= i && i <= this.endID + 2) - ?.map(rowId => ( + .map(rowId => ( { })} ))} + -
+ {/*
*/}
-- cgit v1.2.3-70-g09d2