Skip to content

Commit 7bd1651

Browse files
committed
fix: issue with pixels without decimal point
1 parent 535b490 commit 7bd1651

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/pluggableWidgets/datagrid-web/src/model/stores/GridSize.store.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,10 @@ export class GridSizeStore {
6060

6161
get templateColumnsHead(): string | undefined {
6262
return this.columnSizes
63-
?.map(s => {
64-
const str = s.toString();
65-
return `${str.slice(0, str.indexOf(".") + 4)}px`;
63+
?.map(size => {
64+
const str = size.toString();
65+
const dotIndex = str.indexOf(".");
66+
return `${dotIndex === -1 ? str : str.slice(0, dotIndex + 4)}px`;
6667
})
6768
.join(" ");
6869
}

0 commit comments

Comments
 (0)