Skip to content

Commit 05eb83c

Browse files
authored
Fixed a bug when a string was specified for colSpan (#190)
1 parent 9ddd3c5 commit 05eb83c

File tree

5 files changed

+25
-4
lines changed

5 files changed

+25
-4
lines changed

packages/cheetah-grid/package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/cheetah-grid/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cheetah-grid",
3-
"version": "0.14.0",
3+
"version": "0.14.2",
44
"description": "Cheetah Grid is a high performance grid engine that works on canvas",
55
"keywords": [
66
"spreadsheet",

packages/cheetah-grid/src/js/core/DrawGrid.ts

+18
Original file line numberDiff line numberDiff line change
@@ -3258,6 +3258,24 @@ export abstract class DrawGrid extends EventTarget implements DrawGridAPI {
32583258
frozenColCount
32593259
);
32603260
}
3261+
/**
3262+
* gets or sets the number of pixels that an element's content is scrolled vertically
3263+
*/
3264+
get scrollTop(): number {
3265+
return this[_].scrollable.scrollTop;
3266+
}
3267+
set scrollTop(scrollTop) {
3268+
this[_].scrollable.scrollTop = scrollTop;
3269+
}
3270+
/**
3271+
* gets or sets the number of pixels that an element's content is scrolled from its left edge
3272+
*/
3273+
get scrollLeft(): number {
3274+
return this[_].scrollable.scrollLeft;
3275+
}
3276+
set scrollLeft(scrollLeft) {
3277+
this[_].scrollable.scrollLeft = scrollLeft;
3278+
}
32613279
/**
32623280
* Get the value of cell with the copy action.
32633281
* <p>

packages/cheetah-grid/src/js/list-grid/layout-map/internal/multi-layout.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ class LayoutObjectGrid<T, D extends HasSpans> {
5151
this.objects.push(obj);
5252
this.objectMap[id] = obj;
5353
col = this._findStartCell(col, row);
54-
const rowSpan = cell.rowSpan ?? 1;
55-
const colSpan = cell.colSpan ?? 1;
54+
const rowSpan = Number(cell.rowSpan ?? 1);
55+
const colSpan = Number(cell.colSpan ?? 1);
5656
const endRow = row + rowSpan;
5757
const endCol = col + colSpan;
5858
for (let rowIndex = row; rowIndex < endRow; rowIndex++) {

packages/cheetah-grid/src/js/ts-types/grid-engine.ts

+3
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ export interface DrawGridAPI {
4141
readonly visibleColCount: number;
4242
readonly topRow: number;
4343
readonly leftCol: number;
44+
scrollLeft: number;
45+
scrollTop: number;
46+
4447
getElement(): HTMLElement;
4548
focus(): void;
4649
hasFocusGrid(): boolean;

0 commit comments

Comments
 (0)