diff --git a/src/DataSet/CellSet.js b/src/DataSet/CellSet.js index 8283a14..def299c 100644 --- a/src/DataSet/CellSet.js +++ b/src/DataSet/CellSet.js @@ -148,6 +148,7 @@ class CellSet extends DataSetComponent { } combinationTuples.push(combinationTuple); } + if (cellIndices.length === 0){ combinationTuples.push([0]); } @@ -162,6 +163,14 @@ class CellSet extends DataSetComponent { if (includeGroupingId) { relationDefinition.push(quoteIdentifierWhenRequired(TupleSet.groupingIdAlias)); } + + if (combinationTuples[0].length !== relationDefinition.length){ + // this is https://github.com/rpbouman/huey/issues/360 + // I think this shouldn't happen anymore but we keep this in for now. + // + debugger; + } + relationDefinition = `${quoteIdentifierWhenRequired(CellSet.#tupleDataRelationName)}(\n ${relationDefinition.join('\n, ')}\n)`; tuplesSql = `${relationDefinition} AS (\n FROM (VALUES\n ${tuplesSql}\n )\n)`; return tuplesSql; diff --git a/src/PivotTableUi/PivotTableUi.css b/src/PivotTableUi/PivotTableUi.css index 43bc5fa..031c55e 100644 --- a/src/PivotTableUi/PivotTableUi.css +++ b/src/PivotTableUi/PivotTableUi.css @@ -18,6 +18,11 @@ .pivotTableUiContainer[aria-busy=true] { > .pivotTableUiInnerContainer { + /* + this is to prevent scroll events from being generated while the pivot table is updating + https://github.com/rpbouman/huey/issues/360 + */ + overflow: hidden; > .pivotTableUiTable { diff --git a/src/PivotTableUi/PivotTableUi.js b/src/PivotTableUi/PivotTableUi.js index ce28430..ce6a78e 100644 --- a/src/PivotTableUi/PivotTableUi.js +++ b/src/PivotTableUi/PivotTableUi.js @@ -194,9 +194,9 @@ class PivotTableUi extends EventEmitter { clearTimeout(this.#resizeTimeoutId); this.#resizeTimeoutId = undefined; } - this.#resizeTimeoutId = setTimeout(function(){ + this.#resizeTimeoutId = setTimeout(async function(){ if (this.#autoUpdate && !this.#getBusy()) { - this.updatePivotTableUi(); + await this.updatePivotTableUi(); } else { //this.#setNeedsUpdate(true); @@ -285,7 +285,7 @@ class PivotTableUi extends EventEmitter { this.#queryModelFilterConditionBeforeChange = this.#queryModel.getFilterConditionSql(false); } - #queryModelChangeHandler(event, count){ + async #queryModelChangeHandler(event, count){ if (count !== undefined) { return; } @@ -397,7 +397,7 @@ class PivotTableUi extends EventEmitter { } if (needsUpdate){ - this.updatePivotTableUi(); + await this.updatePivotTableUi(); } }