diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/nodes/DataVizBox/components/TableBox.tsx | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/src/client/views/nodes/DataVizBox/components/TableBox.tsx b/src/client/views/nodes/DataVizBox/components/TableBox.tsx index 243c1a0c7..07d151702 100644 --- a/src/client/views/nodes/DataVizBox/components/TableBox.tsx +++ b/src/client/views/nodes/DataVizBox/components/TableBox.tsx @@ -92,29 +92,34 @@ export class TableBox extends React.Component<TableBoxProps> { } } if (useCell && useContainer){ + + // check for 20 (inital value) as end point + if (this.endID == 20){ + let newEnd = this.startID + useContainer.getBoundingClientRect().height / useCell.getBoundingClientRect().height + 1; + newEnd = Math.floor(Number(newEnd)) + if (newEnd<this.endID){ this.endID -= .1; } + if (newEnd>this.endID && this.endID<=this._tableDataIds.length) { this.endID += .1; } + } + // top if (useContainer.scrollTop <= 10 && this.startID >= -1){ - this.startID -= 1; - this.endID -= 1; + this.startID -= .01; + this.endID -= .01; } // bottom else if (useContainer.scrollHeight - 50 <= useContainer.scrollTop + useContainer.getBoundingClientRect().height && this.endID<=this._tableDataIds.length){ - this.startID += 1; - this.endID += 1; + this.startID += .1; + this.endID += .1; } // regular scroll else { let newStart = (useContainer.scrollTop / useCell.getBoundingClientRect().height ) - 1; newStart = Math.floor(Number(newStart)) - if (newStart<this.startID && this.startID>=-1){ this.startID -= 1; } - if (newStart>this.startID) { this.startID += 1; } + if (newStart<this.startID && this.startID>=-1){ this.startID -= .1; this.endID -= -.1; } + if (newStart>this.startID) { this.startID += .1; this.endID += .1; } - let newEnd = this.startID + useContainer.getBoundingClientRect().height / useCell.getBoundingClientRect().height + 1; - newEnd = Math.floor(Number(newEnd)) - if (newEnd<this.endID){ this.endID -= 1; } - if (newEnd>this.endID && this.endID<=this._tableDataIds.length) { this.endID += 1; } } } else { |